| 50 | } |
| 51 | |
| 52 | function restStatusHandler(className, config) { |
| 53 | const auth = Auth.master(config); |
| 54 | function create(object) { |
| 55 | return rest.create(config, auth, className, object).then(({ response }) => { |
| 56 | return { ...object, ...response }; |
| 57 | }); |
| 58 | } |
| 59 | |
| 60 | function update(where, object) { |
| 61 | return pushPromiseQueue.enqueue(where.objectId, () => |
| 62 | rest |
| 63 | .update(config, auth, className, { objectId: where.objectId }, object) |
| 64 | .then(({ response }) => { |
| 65 | return { ...object, ...response }; |
| 66 | }) |
| 67 | ); |
| 68 | } |
| 69 | |
| 70 | return Object.freeze({ |
| 71 | create, |
| 72 | update, |
| 73 | }); |
| 74 | } |
| 75 | |
| 76 | export function jobStatusHandler(config) { |
| 77 | let jobStatus; |