import { post, patch, del } from "./baseApi"; /** * Function wrapping POST request for creating prices * @param {string} get_employee_uuid - UUID of the employee * @param {string} get_work_type_uuid - UUID of the work type * @param {double} amount - amount rate per hour */ export function createPrice(get_employee_uuid, get_work_type_uuid, amount) { return post("/price/", { get_employee_uuid, get_work_type_uuid, amount }).then(resp => Promise.resolve(resp)); } /** * Function wrapping PATCH request for updating prices * @param {string} uuid - UUID of the price * @param {double} amount - new amount rate per hour */ export function updatePrice(uuid, amount) { return patch(`/price/${uuid}/`, { amount }).then(resp => Promise.resolve(resp)); } /** * Function wrapping DELETE request for deleting the price * @param {string} uuid - UUID of the price */ export function deletePrice(uuid) { return del(`/price/${uuid}/`).then(resp => Promise.resolve(resp)); }