Files
hossein-por-shop/frontend/composables/api/orders/useDeleteDiscountCode.ts
T
2025-03-18 20:34:42 +03:30

26 lines
541 B
TypeScript

// imports
import { useMutation } from "@tanstack/vue-query";
import { API_ENDPOINTS } from "~/constants";
const useDeleteDiscountCode = () => {
// state
const { $axios: axios } = useNuxtApp();
// methods
const handleDeleteDiscountCode = async () => {
const { data } = await axios.delete(
API_ENDPOINTS.orders.cart.delete_discount
);
return data;
};
return useMutation({
mutationFn: () => handleDeleteDiscountCode(),
});
};
export default useDeleteDiscountCode;