From 85ad719ce690fee08d09599ef9b896ffb76ff33d Mon Sep 17 00:00:00 2001 From: Mamalizz Date: Thu, 13 Mar 2025 01:36:51 +0330 Subject: [PATCH] added use delete cart all --- .../api/orders/useDeleteCartAll.ts | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 frontend/composables/api/orders/useDeleteCartAll.ts diff --git a/frontend/composables/api/orders/useDeleteCartAll.ts b/frontend/composables/api/orders/useDeleteCartAll.ts new file mode 100644 index 0000000..2f956fb --- /dev/null +++ b/frontend/composables/api/orders/useDeleteCartAll.ts @@ -0,0 +1,25 @@ +// imports + +import { useMutation } from "@tanstack/vue-query"; +import { API_ENDPOINTS } from "~/constants"; + +const useDeleteCartAll = () => { + // state + + const { $axios: axios } = useNuxtApp(); + + // methods + + const handleDeleteCartAll = async () => { + const { data } = await axios.delete( + API_ENDPOINTS.orders.cart.delete_all + ); + return data; + }; + + return useMutation({ + mutationFn: () => handleDeleteCartAll(), + }); +}; + +export default useDeleteCartAll;