diff --git a/src/pages/04_product-service/MainPage.vue b/src/pages/04_product-service/MainPage.vue index c128bb91..d1abf410 100644 --- a/src/pages/04_product-service/MainPage.vue +++ b/src/pages/04_product-service/MainPage.vue @@ -13,11 +13,7 @@ import TooltipComponent from 'components/TooltipComponent.vue'; import { dialog } from 'src/stores/utils'; import useProductServiceStore from 'src/stores/product-service'; -import { - Product, - ProductCreate, - ProductUpdate, -} from 'src/stores/product-service/types'; +import { Product, ProductCreate } from 'src/stores/product-service/types'; const productServiceStore = useProductServiceStore(); @@ -79,7 +75,7 @@ const formData = ref({ const currentId = ref(''); const currentIdType = ref(''); const resultSearchGroup = ref(); -const resultSearchType = ref(); +const resultSearchType = ref<(Product & { productGroupId: string })[]>(); async function searchGroup() { const resultList = await fetchListProductService({ @@ -110,6 +106,17 @@ async function fetchListGroups() { } } +async function searchType() { + const res = await await fetchListProductServiceType({ + query: inputSearch.value, + productGroupId: currentId.value, + }); + + if (res) { + resultSearchType.value = res; + } +} + async function submitType() { if (drawerInfo.value) { await editProductServiceType(currentIdType.value, { @@ -339,7 +346,7 @@ watch(productMode, () => (inputSearch.value = '')); productMode === 'group' ? searchGroup() : productMode === 'type' - ? console.log('type') + ? searchType() : '' " >