From 70f153558112d624be71fa19f6d99e0c28d1454a Mon Sep 17 00:00:00 2001 From: Starstrike Date: Thu, 1 May 2025 09:22:07 -0400 Subject: [PATCH] Add type annotations for event parameter --- backend/src/index.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/backend/src/index.ts b/backend/src/index.ts index 3e39e26..d36f9bd 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -85,7 +85,17 @@ app.get('/api/events', async (req: Request, res: Response) => { const rows = await db.all('SELECT * FROM events'); // Add the full path to wallpapers - const events = rows.map(event => ({ + const events = rows.map((event: { + id: number; + title: string; + description: string; + date: string; + location: string; + slug: string; + needed_items: string | null; + wallpaper: string | null; + created_at: string; + }) => ({ ...event, wallpaper: event.wallpaper ? `/uploads/wallpapers/${event.wallpaper}` : null, needed_items: event.needed_items ? JSON.parse(event.needed_items) : []