1404/11/08-store style

This commit is contained in:
2026-01-28 11:17:48 +03:30
parent 1d6f342ff1
commit 00c2e38ab9
23 changed files with 2047 additions and 127 deletions
+11
View File
@@ -0,0 +1,11 @@
import useAxios from "@/utils/useAxios";
import type {PInventory, Product} from "@/models/products";
import type {PWallet, Wallet} from '@/models/wallet'
import type {Order} from "@/models/order";
import {useUserStore} from "@/store/userStore";
const userStore = useUserStore()
export const checkoutCart = async (orders: Order[]): Promise<any> => {
return await useAxios.post<Order[]>(`/customer/cart/checkout`, orders)
}
+1
View File
@@ -11,6 +11,7 @@ export const createOrder = async (obj: Order): Promise<any> => {
return await useAxios.post<Order>(`/customer${!userStore.isSingle ? '' : '/single'}/order`, obj)
}
export const getOrders = async (tbl: Ref<UnwrapRef<TableInput>>): Promise<TableOutput<Transaction>> => {
return await useAxios.post<TableOutput<Order>>(`/customer${!userStore.isSingle ? '' : '/single'}/order/table`, tbl)
}
+3
View File
@@ -6,6 +6,9 @@ import type { PWallet, Wallet } from '@/models/wallet'
export const getProducts = async (): Promise<any> => {
return await useAxios.get<Product[]>(`/customer/product/list`)
}
export const getProductById = async ( id:number|null): Promise<any> => {
return await useAxios.get<Product[]>(`/customer/product/list/${id}`)
}
export const getProductInventory = async (): Promise<any> => {
return await useAxios.post<PInventory[]>(`/customer/wallet/product/table`)
}