diff --git a/backend/services/falukantService.js b/backend/services/falukantService.js index 57b5386..1142142 100644 --- a/backend/services/falukantService.js +++ b/backend/services/falukantService.js @@ -3671,6 +3671,7 @@ class FalukantService extends BaseService { } async getProductPricesInCities(hashedUserId, productId, currentPrice, currentRegionId = null) { + console.log(`[getProductPricesInCities] Called with productId: ${productId}, currentPrice: ${currentPrice}, currentRegionId: ${currentRegionId}`); const user = await this.getFalukantUserByHashedId(hashedUserId); const character = await FalukantCharacter.findOne({ where: { userId: user.id } }); if (!character) { diff --git a/frontend/src/components/falukant/RevenueSection.vue b/frontend/src/components/falukant/RevenueSection.vue index 2a05085..2e98004 100644 --- a/frontend/src/components/falukant/RevenueSection.vue +++ b/frontend/src/components/falukant/RevenueSection.vue @@ -99,11 +99,13 @@ } }, async loadPricesForAllProducts() { + 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, @@ -111,6 +113,7 @@ 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);