WB stats reliability: fix client apply-after-refetch, normalize ad dates, and add cache fallback\n\n- SalesTab: apply data immediately after refetch success to avoid empty state\n- Service: normalize advertising day dates to YYYY-MM-DD for correct range checks\n- Resolver: fallback to cached advertisingData when productsData is missing (429)\n\nHelps show data even when WB API rate-limits and fixes mixed-date aggregation.
This commit is contained in:
@ -232,7 +232,11 @@ const SalesTab = React.memo(({
|
||||
}
|
||||
if (result.data?.getWildberriesStatistics?.success) {
|
||||
console.warn('Sales: Loading fresh data from API')
|
||||
// Обрабатываем данные в существующем useEffect
|
||||
const rows = result.data.getWildberriesStatistics.data || []
|
||||
if (rows.length > 0) {
|
||||
// Применяем данные сразу, не дожидаясь обновления wbData
|
||||
applyData(rows)
|
||||
}
|
||||
lastLoadedKeyRef.current = loadKey
|
||||
}
|
||||
} catch (error) {
|
||||
|
Reference in New Issue
Block a user