UNPKG

lml-main

Version:

This is now a mono repository published into many standalone packages.

31 lines 1.43 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var redux_observable_1 = require("redux-observable"); var cosmoui_1 = require("cosmoui"); var actions_1 = require("../actions"); exports.fetchJobsByJobNumberSuccess = function (action$, store) { return action$.ofType(actions_1.FETCH_JOBS_BY_JOB_NUMBER.SUCCESS) .mergeMap(function (action) { var res = []; var _a = action.result, jobs = _a.jobs, scrMatches = _a.scrMatches, jobDelays = _a.jobDelays, jobStatuses = _a.jobStatuses; if (jobs) { res.push(actions_1.setJobsByIdBatch(jobs)); } if (jobStatuses) { res.push(actions_1.setJobStatusSearch(jobStatuses, action.args.searchKey, action.args.params)); } if (jobDelays) { res.push(actions_1.setJobDelayBatch(jobDelays)); } if (scrMatches) { res.push(actions_1.setSmartMatchesBatch(scrMatches)); } return res; }); }; exports.fetchJobsByJobNumberError = function (action$, store) { return action$.ofType(actions_1.FETCH_JOBS_BY_JOB_NUMBER.ERROR) .mapTo(cosmoui_1.notificationError('There was a problem fetching the selected jobs. Please refresh.')); }; exports.fetchJobsByJobNumberEpics = redux_observable_1.combineEpics(exports.fetchJobsByJobNumberSuccess, exports.fetchJobsByJobNumberError); //# sourceMappingURL=fetch-jobs-by-job-number.js.map