UNPKG

integreat

Version:
10 lines 492 B
import { createErrorResponse } from '../utils/response.js'; export default (jobs) => async function run(action, { dispatch, setProgress }) { const { payload: { jobId }, meta: { id } = {}, } = action; const job = typeof jobId === 'string' ? jobs.get(jobId) : undefined; if (!job) { return createErrorResponse(`No valid job with id '${jobId}'`, 'handler:RUN', 'notfound'); } return await job.run(action, dispatch, setProgress, id); }; //# sourceMappingURL=run.js.map