added use delete discount code
This commit is contained in:
@@ -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;
|
||||||
Reference in New Issue
Block a user