How did this go unnoticed for so long

This commit is contained in:
Regalijan 2024-02-15 13:10:57 -05:00
parent 69f407142d
commit 43b1f1d136
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -127,9 +127,9 @@ export async function onRequestPut(context: RequestContext) {
"SELECT open FROM inactivity_notices WHERE id = ?;", "SELECT open FROM inactivity_notices WHERE id = ?;",
) )
.bind(context.params.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); return jsonError("Cannot modify a closed inactivity notice", 403);
const { departments, end, reason, start } = context.data.body; const { departments, end, reason, start } = context.data.body;