From e7243cffea40a3e17c124bd9b91bf1a8a18643be Mon Sep 17 00:00:00 2001 From: Andrzej Stepien Date: Mon, 11 Sep 2023 14:44:01 +0200 Subject: [PATCH] add destroy and create API calls --- src/APIcalls.mjs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/APIcalls.mjs b/src/APIcalls.mjs index 72ccb34..33bd9c6 100644 --- a/src/APIcalls.mjs +++ b/src/APIcalls.mjs @@ -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) + } +}