ITHC: enforce administrative case deletion authorization

This commit is contained in:
2026-10-27 05:40:50 +00:00
parent 8b607d8134
commit 5e98d6e8c2
4 changed files with 333 additions and 20 deletions
+44 -13
View File
@@ -2,7 +2,6 @@
import { useState } from "react";
import Link from "next/link";
import { bytesToSize } from "../../../components/utils";
import { deleteAwaitingSubmissionsFromBlob } from "../../../actions/services/documentService";
import { consoleLogger } from "../../../actions/core/logger";
import { formatBlobDates } from "../utils/adminHelper";
@@ -136,20 +135,52 @@ export default function StorageTab({ data, repCompleteCount }) {
{folder.hasTmpFile && (
<>
<button
onClick={() => {
confirm(
"Do you want to remove this unsubmitted appeal " +
folder.folderPath +
"?\n"
) &&
(deleteCaseItem(
c.container,
folder.folderPath,
setData
),
onClick={async () => {
if (
!confirm(
"Do you want to remove this unsubmitted appeal " +
folder.folderPath +
"?\n"
)
) {
return;
}
try {
const response =
await fetch(
"/api/admin/deleteblobcase",
{
method: "POST",
headers:
{
"Content-Type":
"application/json"
},
body: JSON.stringify(
{
container:
c.container,
casefolderID:
folder.folderPath
}
)
}
);
if (!response.ok) {
throw new Error(
"Unable to delete case"
);
}
alert(
"Temp case Deleted!"
));
);
window.location.reload();
} catch (error) {
consoleLogger(error);
}
}}
>
Delete this TMP appeal