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.
 
 
 

32 lines
995 B

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));
}