From c65e2b535d635eb8e8a3dc9c71295c0ee8531aae Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Tue, 18 Jun 2024 15:23:49 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20=E0=B9=81=E0=B8=81=E0=B9=89=20type=20Ser?= =?UTF-8?q?vice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/product-service/index.ts | 6 +++--- src/stores/product-service/types.ts | 27 +++++++++++++++------------ 2 files changed, 18 insertions(+), 15 deletions(-) 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 {