Refactor and remove debug logging in FalukantService and RevenueSection for cleaner code

- Eliminated console logs in the getProductPricesInCities method of FalukantService to streamline the price calculation process and reduce clutter in the output.
- Removed unnecessary debug logs in RevenueSection related to loading product prices, enhancing performance and focusing on essential functionality.
- Improved overall code readability by reducing logging noise while maintaining necessary functionality.
This commit is contained in:
Torsten Schulz (local)
2025-12-03 11:35:13 +01:00
parent 56c3569b68
commit 90fbcaf31d
2 changed files with 0 additions and 13 deletions

View File

@@ -105,16 +105,13 @@
},
async loadPricesForAllProducts() {
if (this.currentRegionId === null || this.currentRegionId === undefined) {
console.log(`[RevenueSection] Skipping loadPricesForAllProducts - currentRegionId is null/undefined`);
return;
}
console.log(`[RevenueSection] loadPricesForAllProducts called, products: ${this.products.length}, currentRegionId: ${this.currentRegionId}`);
for (const product of this.products) {
if (this.loadingPrices.has(product.id)) continue;
this.loadingPrices.add(product.id);
try {
const currentPrice = parseFloat(this.calculateProductRevenue(product).absolute);
console.log(`[RevenueSection] Loading prices for product ${product.id} (${product.labelTr}), currentPrice: ${currentPrice}, currentRegionId: ${this.currentRegionId}`);
const { data } = await apiClient.get('/api/falukant/products/prices-in-cities', {
params: {
productId: product.id,
@@ -122,7 +119,6 @@
currentRegionId: this.currentRegionId
}
});
console.log(`[RevenueSection] Received better prices for product ${product.id}:`, data);
this.$set(product, 'betterPrices', data || []);
} catch (error) {
console.error(`Error loading prices for product ${product.id}:`, error);