This commit is contained in:
2025-10-09 08:54:05 +07:00
parent 82c75ab264
commit f7c96a0258
4 changed files with 26 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,9 @@
import axios from "axios";
export const CartApi = {
getCartByUserId: async (userId: string) => {
let result = await axios.get(`${import.meta.env.VITE_SV_HOST}/carts?userId=${userId}`)
return result.data
}
}

View File

@@ -1,3 +1,4 @@
import { CartApi } from "./core/cart.api";
import { CategoryApi } from "./core/category.api";
import { CloudianryApi } from "./core/cloudinary.api";
import { ProductApi } from "./core/product.api";
@@ -7,5 +8,6 @@ export const Apis = {
user: UserApi,
category: CategoryApi,
cloundInary: CloudianryApi,
product: ProductApi
product: ProductApi,
cart: CartApi
}

6
src/types/cart.type.ts Normal file
View File

@@ -0,0 +1,6 @@
export interface CartItem {
id: string;
userId: string;
productId: string;
quantity: number
}