fix: function name

This commit is contained in:
Methapon Metanipat 2024-10-15 16:13:00 +07:00
parent 29998081d4
commit 8ce8c9a977
3 changed files with 29 additions and 24 deletions

View file

@ -45,7 +45,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
}
}
async function fetchListProductServiceById(groupId: string) {
async function fetchProductGroupById(groupId: string) {
const res = await api.get<ProductGroup>(`/product-group/${groupId}`);
if (!res) return false;
@ -55,7 +55,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
}
}
async function fetchListProductService(opts?: {
async function fetchProductGroup(opts?: {
page?: number;
pageSize?: number;
query?: string;
@ -86,7 +86,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
return false;
}
async function createProductService(data: ProductGroupCreate) {
async function createProductGroup(data: ProductGroupCreate) {
const { code, ...payload } = data;
const res = await api.post<ProductGroupCreate>('/product-group', {
@ -102,7 +102,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
return false;
}
async function editProductService(
async function editProductGroup(
groupId: string,
data: Partial<ProductGroupUpdate>,
) {
@ -121,7 +121,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
return false;
}
async function deleteProductService(groupId: string) {
async function deleteProductGroup(groupId: string) {
const res = await api.delete(`/product-group/${groupId}`);
if (!res) return false;
@ -626,11 +626,11 @@ const useProductServiceStore = defineStore('api-product-service', () => {
workNameItems,
fetchStatsProductGroup,
fetchListProductServiceById,
fetchListProductService,
createProductService,
editProductService,
deleteProductService,
fetchProductGroupById,
fetchProductGroup,
createProductGroup,
editProductGroup,
deleteProductGroup,
fetchStatsProduct,
fetchListProduct,