fix: corriger erreurs TypeScript TS7006 dans server/db.ts (types explicites pour lambdas)

This commit is contained in:
Manus Deploy
2026-05-03 06:28:24 -04:00
parent 3d1bff45a3
commit a8ba0ee979

View File

@@ -16,6 +16,7 @@ import {
rssSettings, rssSettings,
type InsertRssFeed, type InsertRssFeed,
type InsertRssSettings, type InsertRssSettings,
type ImportLog,
type RssFeed, type RssFeed,
type RssSettings, type RssSettings,
} from "../drizzle/schema"; } from "../drizzle/schema";
@@ -182,9 +183,9 @@ export async function getVeilleDistinctValues() {
]); ]);
return { return {
categories: cats.map((r) => r.value!).filter(Boolean).sort(), categories: cats.map((r: { value: string | null }) => r.value!).filter(Boolean).sort(),
niveaux: niveaux.map((r) => r.value!).filter(Boolean).sort(), niveaux: niveaux.map((r: { value: string | null }) => r.value!).filter(Boolean).sort(),
territoires: territoires.map((r) => r.value!).filter(Boolean).sort(), territoires: territoires.map((r: { value: string | null }) => r.value!).filter(Boolean).sort(),
}; };
} }
@@ -249,8 +250,8 @@ export async function getAapDistinctValues() {
]); ]);
return { return {
regions: regions.map((r) => r.value!).filter(Boolean).sort(), regions: regions.map((r: { value: string | null }) => r.value!).filter(Boolean).sort(),
departements: departements.map((r) => r.value!).filter(Boolean).sort(), departements: departements.map((r: { value: string | null }) => r.value!).filter(Boolean).sort(),
}; };
} }
@@ -318,9 +319,9 @@ export async function getImportStats() {
]); ]);
const total = allLogs.length; const total = allLogs.length;
const success = allLogs.filter(l => l.status === 'success').length; const success = allLogs.filter((l: ImportLog) => l.status === 'success').length;
const errors = allLogs.filter(l => l.status === 'error').length; const errors = allLogs.filter((l: ImportLog) => l.status === 'error').length;
const totalNewRows = allLogs.reduce((sum, l) => sum + (l.newRows ?? 0), 0); const totalNewRows = allLogs.reduce((sum: number, l: ImportLog) => sum + (l.newRows ?? 0), 0);
return { return {
totalVeille: Number(veilleCount[0]?.count ?? 0), totalVeille: Number(veilleCount[0]?.count ?? 0),