From a4038327355010ae478fa86967ed78b7f328e246 Mon Sep 17 00:00:00 2001 From: Regalijan Date: Thu, 23 Oct 2025 15:22:45 -0400 Subject: [PATCH] Only apply decisions to departments the notice covers --- functions/api/inactivity/[id].ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/functions/api/inactivity/[id].ts b/functions/api/inactivity/[id].ts index 4283ab0..138dfa5 100644 --- a/functions/api/inactivity/[id].ts +++ b/functions/api/inactivity/[id].ts @@ -91,8 +91,10 @@ export async function onRequestPost(context: RequestContext) { requestedNotice.decisions, ); - for (const department of userAdminDepartments) + for (const department of userAdminDepartments) { + if (!JSON.parse(requestedNotice.departments).includes(department)) continue; decisions[department] = accepted; + } const applicableDepartments = JSON.parse(requestedNotice.departments).length;