diff --git a/src/stores/product-service/index.ts b/src/stores/product-service/index.ts index f57181b6..859cdd3d 100644 --- a/src/stores/product-service/index.ts +++ b/src/stores/product-service/index.ts @@ -14,7 +14,7 @@ import { ProductUpdate, Service, ServiceCreate, - ResultProductOnWork, + ServiceById, } from './types'; const useProductServiceStore = defineStore('api-product-service', () => { @@ -423,7 +423,7 @@ const useProductServiceStore = defineStore('api-product-service', () => { const query = params.toString(); - const res = await api.get>( + const res = await api.get>( `/service/${serviceId}/work${(params && '?'.concat(query)) || ''}`, { headers: { @@ -443,7 +443,7 @@ const useProductServiceStore = defineStore('api-product-service', () => { } async function fetchListServiceById(serviceId: string) { - const res = await api.get(`/service/${serviceId}`); + const res = await api.get(`/service/${serviceId}`); if (!res) return false; diff --git a/src/stores/product-service/types.ts b/src/stores/product-service/types.ts index 2ba8b070..2b3b2198 100644 --- a/src/stores/product-service/types.ts +++ b/src/stores/product-service/types.ts @@ -7,7 +7,7 @@ export interface Service { createdAt: string; createdBy: string; status: string; - attributes: string; + attributes: Attributes; detail: string; name: string; code: string; @@ -17,15 +17,16 @@ export interface Service { } export interface Work { - updatedAt: string; - updateBy: string; - createdAt: string; - createdBy: string; - serviceId: string; - status: string; - attributes: string; - name: string; id: string; + order: number; + name: string; + attributes: Attributes; + status: Status; + serviceId: string; + createdBy: string | null; + createdAt: string; + updateBy: string | null; + updatedAt: string; } export interface ServiceCreate { @@ -50,16 +51,18 @@ export interface Attributes { type AdditionalType = 'string' | 'number' | 'boolean' | Date; // Product -export interface ResultProductOnWork { - productOnWork: ProductOnWork[]; +export interface ServiceById { + work: Work & { productOnWork: ProductOnWork[] }[]; updatedAt: string; updateBy: string; createdAt: string; createdBy: string; - status: string; + status: Status; attributes: string; name: string; + order: number; id: string; + imageUrl: 'string'; } export interface ProductOnWork {