added use delete discount code

This commit is contained in:
Mamalizz
2025-03-18 20:34:42 +03:30
parent e27a44f8a5
commit 2721e0ce1e
@@ -0,0 +1,25 @@
// 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;