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;