You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
511 B
19 lines
511 B
import { post } from "./baseApi"; |
|
|
|
export function createCShifts(postBodies) { |
|
const cShiftUrl = `/cshift/`; |
|
// return Promise.all( |
|
// postBodies.map(postBody => post(cShiftUrl, postBody).catch(() => false)) |
|
// ).then(postResponses => { |
|
// Promise.resolve(postResponses); |
|
// }); |
|
return Promise.all( |
|
postBodies.map(postBody => |
|
post(cShiftUrl, postBody).catch(err => { |
|
return { error: true, ...err }; |
|
}) |
|
) |
|
).then(resp => { |
|
return Promise.resolve(resp); |
|
}); |
|
}
|
|
|