feat: ต่อ api จำนวน ของ Product

This commit is contained in:
Net 2024-06-18 16:26:49 +07:00
parent 2ffc252a8b
commit 372d63f99e
2 changed files with 21 additions and 1 deletions

View file

@ -239,6 +239,17 @@ const useProductServiceStore = defineStore('api-product-service', () => {
}
// Product
async function fetchStatsProduct() {
const res = await api.get('/product/stats');
if (!res) return false;
if (res.status === 200) {
return res.data;
}
}
async function fetchListProduct(
opts?: {
query?: string;
@ -500,6 +511,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
editProductService,
deleteProductService,
fetchStatsProduct,
fetchListProduct,
createProduct,
fetchListProductById,