From 9c266eee8213aedb80882fb4e9d8f2ce4e9c62f3 Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Mon, 17 Jun 2024 17:58:05 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=20=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88?= =?UTF-8?q?=E0=B8=A1=20opts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/product-service/index.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/stores/product-service/index.ts b/src/stores/product-service/index.ts index 7f1d8fb0..f8c5d9ae 100644 --- a/src/stores/product-service/index.ts +++ b/src/stores/product-service/index.ts @@ -40,7 +40,11 @@ const useProductServiceStore = defineStore('api-product-service', () => { } async function fetchListProductServiceType( - opts?: { query?: string; productGroupId?: string }, + opts?: { + query?: string; + productGroupId?: string; + status?: 'CREATED' | 'ACTIVE' | 'INACTIVE'; + }, flow?: { sessionId: string; refTransactionId: string; @@ -90,7 +94,7 @@ const useProductServiceStore = defineStore('api-product-service', () => { if (!res) return false; - if (res.status === 200) { + if (res.status === 201) { return res.data; } @@ -154,7 +158,7 @@ const useProductServiceStore = defineStore('api-product-service', () => { } async function fetchListProductService( - opts?: { query?: string }, + opts?: { query?: string; status?: 'CREATED' | 'ACTIVE' | 'INACTIVE' }, flow?: { sessionId: string; refTransactionId: string; @@ -234,7 +238,12 @@ const useProductServiceStore = defineStore('api-product-service', () => { // Product async function fetchListProduct( - opts?: { query?: string; page?: number; pageSize?: number }, + opts?: { + query?: string; + page?: number; + pageSize?: number; + productTypeId?: string; + }, flow?: { sessionId: string; refTransactionId: string; @@ -269,7 +278,7 @@ const useProductServiceStore = defineStore('api-product-service', () => { } async function createProduct(data: ProductCreate) { - const { code, ...payload } = data; + const { ...payload } = data; const res = await api.post('/product', { ...payload,