bulk cart

This commit is contained in:
hamid zarghami
2025-12-01 10:33:22 +03:30
parent 788d23b185
commit b4b900cfc1
8 changed files with 83 additions and 11 deletions
@@ -0,0 +1,8 @@
import { useMutation } from "@tanstack/react-query";
import * as api from "../service/CartService";
export const useBulkCart = () => {
return useMutation({
mutationFn: api.bulkCart,
});
};
@@ -0,0 +1,7 @@
import { api } from "@/config/axios";
import { BulkCartItem } from "../types/Types";
export const bulkCart = async (params: BulkCartItem) => {
const { data } = await api.post("/public/cart/items/bulk", params);
return data;
};
@@ -0,0 +1,6 @@
export type BulkCartItem = {
items: {
foodId: string;
quantity: number;
}[];
};