Files
ghatreh_user/src/api/products.ts
T
2026-01-28 11:17:48 +03:30

17 lines
721 B
TypeScript

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`)
}
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`)
}
export const getOneProductWallet = async (id: number): Promise<any> => {
return await useAxios.get<PWallet>(`/customer/wallet/product/${id}`)
}