Fix TypeScript errors in experiments feature

- Add experimentMap/onOpenExperiment props to WeeklyRow component
- Export VendorDailyRow type from supabase.ts
- Fix type errors in experiments.ts (unknown[] to string[])
- Add type annotation for allAsins in App.tsx

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
Christian Vidal Wolf
2026-02-20 19:39:56 +01:00
co-authored by Qwen-Coder
parent f93d92da0b
commit a21c0d532c
5 changed files with 24 additions and 17 deletions
+4 -4
View File
@@ -163,16 +163,16 @@ export const getActiveExperimentsForASINs = async (
if (error) throw error;
const map = new Map<string, ActiveExperiment[]>();
for (const asin of asins) {
const experiments = (data || [])
.filter((exp: any) => exp.asins?.includes(asin))
.filter((exp: any) => Array.isArray(exp.asins) && exp.asins.includes(asin))
.map((exp: any) => {
const endDate = exp.end_date ? new Date(exp.end_date) : null;
const daysRemaining = endDate
? Math.ceil((endDate.getTime() - new Date().getTime()) / (1000 * 60 * 60 * 24))
: undefined;
return {
asin,
experiment_id: exp.id,
@@ -184,7 +184,7 @@ export const getActiveExperimentsForASINs = async (
days_remaining: daysRemaining,
} as ActiveExperiment;
});
if (experiments.length > 0) {
map.set(asin, experiments);
}