From 91009f52cdb291fdaa9d55131ac136a7253e21b2 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Sat, 20 Dec 2025 21:28:01 +0100 Subject: [PATCH] Refactor SaleSection component to utilize direct property assignment for betterPrices, enhancing reactivity in Vue3. Update inventory mapping to ensure betterPrices is always an array. --- frontend/src/components/falukant/SaleSection.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/falukant/SaleSection.vue b/frontend/src/components/falukant/SaleSection.vue index 2d81e01..6e01727 100644 --- a/frontend/src/components/falukant/SaleSection.vue +++ b/frontend/src/components/falukant/SaleSection.vue @@ -290,6 +290,8 @@ this.inventory = response.data.map(item => ({ ...item, sellQuantity: item.totalQuantity, + // Vue3: besserPrices direkt als Property setzen (statt this.$set) + betterPrices: Array.isArray(item.betterPrices) ? item.betterPrices : [], })); await this.loadPricesForInventory(); } catch (error) { @@ -310,10 +312,11 @@ currentPrice: currentPrice } }); - this.$set(item, 'betterPrices', data || []); + // Vue3: direkte Zuweisung ist reaktiv + item.betterPrices = Array.isArray(data) ? data : []; } catch (error) { console.error(`Error loading prices for item ${itemKey}:`, error); - this.$set(item, 'betterPrices', []); + item.betterPrices = []; } finally { this.loadingPrices.delete(itemKey); }