From cdf4b3069f839d289dd40c70c87dd80cad7edc43 Mon Sep 17 00:00:00 2001 From: Ruslan Bakiev <572431+veikab@users.noreply.github.com> Date: Fri, 16 Jan 2026 09:38:17 +0700 Subject: [PATCH] fix(catalog): fix supplier products and remove old offers page - Fix computed products to read from offer directly instead of offer.lines - Remove obsolete offers/[uuid].vue (replaced by new flow) --- app/pages/catalog/offers/[uuid].vue | 223 ------------------ .../catalog/suppliers/[supplierId]/index.vue | 16 +- 2 files changed, 7 insertions(+), 232 deletions(-) delete mode 100644 app/pages/catalog/offers/[uuid].vue diff --git a/app/pages/catalog/offers/[uuid].vue b/app/pages/catalog/offers/[uuid].vue deleted file mode 100644 index cd41ada..0000000 --- a/app/pages/catalog/offers/[uuid].vue +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - {{ t('catalogOffer.states.loading') }} - - - - - - - - - - - {{ t('catalogOffer.not_found.title') }} - {{ t('catalogOffer.not_found.subtitle') }} - - {{ t('catalogOffer.actions.back_to_catalog') }} - - - - - - - - - - - - - - - - - {{ offer.productName }} - - {{ offer.productName }} - - {{ offer.categoryName }} - - - - - {{ formatPrice(offer.pricePerUnit, offer.currency) }} - - {{ t('catalogOffer.labels.per_unit', { unit: displayUnit(offer.unit) }) }} - - - - - {{ t('catalogOffer.labels.quantity_with_unit', { quantity: offer.quantity, unit: displayUnit(offer.unit) }) }} - - {{ t('catalogOffer.labels.valid_until', { date: formatDate(offer.validUntil) }) }} - - - - - - - - - - - {{ t('catalogOffer.sections.description.title') }} - {{ offer.description }} - - - - - - - - {{ t('catalogOffer.sections.supplier.title') }} - - - - - - - - {{ t('catalogOffer.sections.location.title') }} - - - - {{ countryFlag }} - - {{ offer.locationName }} - {{ offer.locationCountry }} - - - - - - - - - - - - - diff --git a/app/pages/catalog/suppliers/[supplierId]/index.vue b/app/pages/catalog/suppliers/[supplierId]/index.vue index 4b92f50..6998272 100644 --- a/app/pages/catalog/suppliers/[supplierId]/index.vue +++ b/app/pages/catalog/suppliers/[supplierId]/index.vue @@ -127,15 +127,13 @@ const mapItems = computed(() => { const products = computed(() => { const productsMap = new Map() offers.value.forEach(offer => { - offer.lines?.forEach((line: any) => { - if (line?.productUuid && line?.productName && !productsMap.has(line.productUuid)) { - productsMap.set(line.productUuid, { - uuid: line.productUuid, - name: line.productName, - locationUuid: offer.locationUuid - }) - } - }) + if (offer.productUuid && offer.productName && !productsMap.has(offer.productUuid)) { + productsMap.set(offer.productUuid, { + uuid: offer.productUuid, + name: offer.productName, + locationUuid: offer.locationUuid + }) + } }) return Array.from(productsMap.values()) })