Compare commits

...

3 Commits

3 changed files with 19 additions and 14 deletions

View File

@@ -169,20 +169,22 @@ export default function () {
Decisions:
<br />
Approved:
{Object.keys(currentInactivity.decisions ?? {}).filter(
(d) => currentInactivity.decisions[d],
)}
{Object.keys(currentInactivity.decisions ?? {})
.filter((d) => currentInactivity.decisions[d])
.join(", ")}
<br />
Denied:
{Object.keys(currentInactivity.decisions ?? {}).filter(
(d) => !currentInactivity.decisions[d],
)}
{Object.keys(currentInactivity.decisions ?? {})
.filter((d) => !currentInactivity.decisions[d])
.join(", ")}
<br />
Pending:
{currentInactivity.departments?.filter(
{currentInactivity.departments
?.filter(
(d: "DM" | "ET" | "FM" | "WM") =>
typeof currentInactivity.decisions[d] === "undefined",
)}
)
.join(", ")}
</ListItem>
</UnorderedList>
</ModalBody>

View File

@@ -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;

View File

@@ -183,9 +183,10 @@ export async function onRequestPost(context: RequestContext) {
const uploadUrlResults = await Promise.allSettled(uploadUrlPromises);
const reportId = `${Date.now()}${context.request.headers.get(
"cf-ray",
)}${crypto.randomUUID().replaceAll("-", "")}`;
const reportId = `${Date.now()}${context.request.headers
.get("cf-ray")
?.split("-")
?.at(0)}${crypto.randomUUID().replaceAll("-", "")}`;
const { current_user: currentUser } = context.data;
if (filesToProcess.length)