added delete function to product table
This commit is contained in:
@@ -38,5 +38,6 @@
|
||||
"quick-tips-1": "Update the app name to personalize the sidebar and login header.",
|
||||
"quick-tips-2": "Choose a currency code that matches your pricing display, e.g. EUR, CHF, or USD.",
|
||||
"settings-sub": "Manage your app preferences and store defaults.",
|
||||
"preferences": "Preferences"
|
||||
"preferences": "Preferences",
|
||||
"selected": "selected"
|
||||
}
|
||||
@@ -273,3 +273,19 @@ export const fetchSettings = async () => {
|
||||
return { success: true, data: response.data, code: response.code };
|
||||
}
|
||||
};
|
||||
|
||||
export const deleteSelectedProducts = async (uuids: string[]) => {
|
||||
const result = await fetch(`${API_BASE}/products/delete-selection`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(uuids),
|
||||
headers: {
|
||||
Authorization: `Bearer ${Cookies.get("token") || ""}`,
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
const response = await result.json();
|
||||
|
||||
console.log(response);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user