From e0de6610508f72ea3086149576e9a6bbec3de672 Mon Sep 17 00:00:00 2001 From: Starstrike Date: Thu, 1 May 2025 14:54:19 -0400 Subject: [PATCH] fix: Allow clearing event description in update endpoint --- backend/src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/index.ts b/backend/src/index.ts index 651cb65..595502d 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -339,10 +339,10 @@ app.put('/api/events/:slug', async (req: Request, res: Response) => { await db.run( 'UPDATE events SET title = ?, description = ?, date = ?, location = ?, needed_items = ?, rsvp_cutoff_date = ? WHERE slug = ?', [ - title || eventRows[0].title, - description || eventRows[0].description, - date || eventRows[0].date, - location || eventRows[0].location, + title ?? eventRows[0].title, + description === undefined ? eventRows[0].description : description, + date ?? eventRows[0].date, + location ?? eventRows[0].location, JSON.stringify(parsedNeededItems), rsvp_cutoff_date !== undefined ? rsvp_cutoff_date : eventRows[0].rsvp_cutoff_date, slug