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.
29 lines
780 B
29 lines
780 B
import { get, put, post, del } from "./baseApi"; |
|
|
|
export function createCShifts(postBodies) { |
|
return Promise.all( |
|
postBodies.map(postBody => |
|
post("/cshift/", postBody).catch(err => { |
|
return { error: true, ...err }; |
|
}) |
|
) |
|
).then(resp => { |
|
return Promise.resolve(resp); |
|
}); |
|
} |
|
|
|
export function getCShifts(params) { |
|
return get("/cshift/", params).then(resp => Promise.resolve(resp)); |
|
} |
|
|
|
export function getCShift(uuid, params) { |
|
return get(`/cshift/${uuid}/`, params).then(resp => Promise.resolve(resp)); |
|
} |
|
|
|
export function editCShift(uuid, payload) { |
|
return put(`/cshift/${uuid}/`, payload).then(resp => Promise.resolve(resp)); |
|
} |
|
|
|
export function deleteCShift(uuid) { |
|
return del(`/cshift/${uuid}/`).then(resp => Promise.resolve(resp)); |
|
}
|
|
|