Files
2025-03-13 01:36:51 +03:30

26 lines
516 B
TypeScript

// 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;