2025-10-05 09:44:14 +03:30
|
|
|
import useAxios from "@/utils/useAxios";
|
|
|
|
|
import type {PInventory, Product} from "@/models/products";
|
|
|
|
|
import type { PWallet, Wallet } from '@/models/wallet'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const getProducts = async (): Promise<any> => {
|
|
|
|
|
return await useAxios.get<Product[]>(`/customer/product/list`)
|
|
|
|
|
}
|
2026-01-28 11:17:48 +03:30
|
|
|
export const getProductById = async ( id:number|null): Promise<any> => {
|
|
|
|
|
return await useAxios.get<Product[]>(`/customer/product/list/${id}`)
|
|
|
|
|
}
|
2025-10-05 09:44:14 +03:30
|
|
|
export const getProductInventory = async (): Promise<any> => {
|
|
|
|
|
return await useAxios.post<PInventory[]>(`/customer/wallet/product/table`)
|
|
|
|
|
}
|
|
|
|
|
export const getOneProductWallet = async (id: number): Promise<any> => {
|
|
|
|
|
return await useAxios.get<PWallet>(`/customer/wallet/product/${id}`)
|
|
|
|
|
}
|