add destroy and create API calls

This commit is contained in:
Andrzej Stepien 2023-09-11 14:44:01 +02:00
parent ddb446d607
commit e7243cffea
1 changed files with 16 additions and 0 deletions

View File

@ -39,3 +39,19 @@ export const requestEdit = async (data,type) => {
console.error(error)
}
}
export const requestDestroy = async (data,type) => {
try {
const res = await API.post(`/${type}/delete`,data)
return res
} catch (error) {
console.error(error)
}
}
export const requestCreate = async (data,type) => {
try {
const res = await API.post(`/${type}/create`,data)
return res
} catch (error) {
console.log(error)
}
}