fix: corriger erreurs TypeScript TS7006 dans server/db.ts (types explicites pour lambdas)
This commit is contained in:
17
server/db.ts
17
server/db.ts
@@ -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),
|
||||||
|
|||||||
Reference in New Issue
Block a user