Only apply decisions to departments the notice covers
This commit is contained in:
@@ -91,8 +91,10 @@ export async function onRequestPost(context: RequestContext) {
|
|||||||
requestedNotice.decisions,
|
requestedNotice.decisions,
|
||||||
);
|
);
|
||||||
|
|
||||||
for (const department of userAdminDepartments)
|
for (const department of userAdminDepartments) {
|
||||||
|
if (!JSON.parse(requestedNotice.departments).includes(department)) continue;
|
||||||
decisions[department] = accepted;
|
decisions[department] = accepted;
|
||||||
|
}
|
||||||
|
|
||||||
const applicableDepartments = JSON.parse(requestedNotice.departments).length;
|
const applicableDepartments = JSON.parse(requestedNotice.departments).length;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user