From eb41274a502311f03673eb964d6a2d144b4a630b Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Fri, 21 Jun 2024 15:58:42 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E0=B8=95=E0=B8=B1=E0=B8=A7=E0=B9=80?= =?UTF-8?q?=E0=B9=80=E0=B8=9B=E0=B8=A3=20=20workNameItems?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/product-service/index.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/stores/product-service/index.ts b/src/stores/product-service/index.ts index caaa5e40..4e979489 100644 --- a/src/stores/product-service/index.ts +++ b/src/stores/product-service/index.ts @@ -19,9 +19,13 @@ import { ProductOnWork, WorkCreate, } from './types'; +import { ref } from 'vue'; const useProductServiceStore = defineStore('api-product-service', () => { // Product Type + + const workNameItems = ref([]); + async function fetchStatsProductType() { const res = await api.get('/product-type/stats'); @@ -666,7 +670,17 @@ const useProductServiceStore = defineStore('api-product-service', () => { return false; } + async function fetchListOfWork() { + const res = await fetchListWork(); + + if (res) { + workNameItems.value = res.result.map((item) => item.name); + } + } + return { + workNameItems, + fetchStatsProductType, fetchListProductServiceByIdType, fetchListProductServiceType, @@ -702,6 +716,8 @@ const useProductServiceStore = defineStore('api-product-service', () => { editWork, deleteWork, fetchListProductByIdWork, + + fetchListOfWork, }; });