mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 11:55:22 +02:00
fix: resolve LINE level experiments to individual ASINs using salesData so calculation works for product lines
This commit is contained in:
@@ -10,7 +10,10 @@ import { SalesRecord, FilterState, AggregatedData, AdsRecord, TrafficRecord, For
|
||||
import { queryGemini } from './services/geminiService';
|
||||
import { ChartIcon, TableIcon, UploadIcon, DownloadIcon, CloseIcon, TrendingIcon, MegaphoneIcon } from './components/Icons';
|
||||
import { loadSalesData, saveSalesData, clearSalesData, loadAdsData, saveAdsData, clearAdsData } from './services/storage';
|
||||
import { getActiveExperimentsForASINs } from './services/experiments';
|
||||
import {
|
||||
listExperiments,
|
||||
getActiveExperiments,
|
||||
} from './services/experiments';
|
||||
|
||||
// Lazy load heavy components for better initial performance
|
||||
const DataGrid = lazy(() => import('./components/DataGrid'));
|
||||
@@ -258,8 +261,7 @@ const App: React.FC = () => {
|
||||
|
||||
const handleExperimentsFetch = useCallback(async () => {
|
||||
try {
|
||||
const allAsins: string[] = Array.from(new Set(rawData.map(r => String(r.asin).toUpperCase())));
|
||||
const expMap = await getActiveExperimentsForASINs(allAsins);
|
||||
const expMap = await getActiveExperiments(rawData);
|
||||
setExperimentMap(expMap);
|
||||
console.log('[App] Loaded experiments for', expMap.size, 'ASINs');
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user