From 43b1f1d1362f28ec55000121b3b3bf33c10fd445 Mon Sep 17 00:00:00 2001 From: Regalijan Date: Thu, 15 Feb 2024 13:10:57 -0500 Subject: [PATCH] How did this go unnoticed for so long --- functions/api/inactivity/[id].ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/api/inactivity/[id].ts b/functions/api/inactivity/[id].ts index f9de2db..479b8da 100644 --- a/functions/api/inactivity/[id].ts +++ b/functions/api/inactivity/[id].ts @@ -127,9 +127,9 @@ export async function onRequestPut(context: RequestContext) { "SELECT open FROM inactivity_notices WHERE id = ?;", ) .bind(context.params.id) - .run(); + .first(); - if (!Boolean(d1entry.results.at(0)?.open)) + if (!Boolean(d1entry?.open)) return jsonError("Cannot modify a closed inactivity notice", 403); const { departments, end, reason, start } = context.data.body;