Add debug logging in RevenueSection for better price retrieval tracking
- Introduced console logs to track the number of better prices received for each product and the state of the betterPricesMap after updates. - Enhanced the getBetterPrices method with logging to provide visibility into the prices being returned, improving traceability during price evaluations. - These changes aim to facilitate debugging and provide clearer insights into the price handling process within the RevenueSection component.
This commit is contained in:
@@ -130,8 +130,10 @@
|
||||
currentRegionId: this.currentRegionId
|
||||
}
|
||||
});
|
||||
console.log(`[RevenueSection] Product ${product.id} (${product.labelTr}): received ${data?.length || 0} better prices:`, data);
|
||||
// Speichere betterPrices in einem separaten Map, nicht auf dem product Objekt
|
||||
this.$set(this.betterPricesMap, product.id, data || []);
|
||||
console.log(`[RevenueSection] betterPricesMap after update:`, JSON.parse(JSON.stringify(this.betterPricesMap)));
|
||||
} catch (error) {
|
||||
console.error(`Error loading prices for product ${product.id}:`, error);
|
||||
this.$set(this.betterPricesMap, product.id, []);
|
||||
@@ -141,7 +143,9 @@
|
||||
}
|
||||
},
|
||||
getBetterPrices(productId) {
|
||||
return this.betterPricesMap[productId] || [];
|
||||
const prices = this.betterPricesMap[productId] || [];
|
||||
console.log(`[RevenueSection] getBetterPrices(${productId}): returning`, prices);
|
||||
return prices;
|
||||
},
|
||||
getCityPriceClass(branchType) {
|
||||
if (branchType === 'store') return 'city-price-green';
|
||||
|
||||
Reference in New Issue
Block a user