what could go wrong kekw
This commit is contained in:
parent
03c2cf1859
commit
e2b2aad3d6
@ -147,7 +147,7 @@ export default function () {
|
||||
const itemId = searchParams.get("id");
|
||||
const itemType = searchParams.get("type");
|
||||
|
||||
const entryData: { [k: string]: any }[] = await queueReq.json();
|
||||
let entryData: { [k: string]: any }[] = await queueReq.json();
|
||||
const newEntries = [...entries];
|
||||
|
||||
if (
|
||||
@ -155,6 +155,12 @@ export default function () {
|
||||
itemType &&
|
||||
["appeal", "gma", "inactivity", "report"].includes(itemType)
|
||||
) {
|
||||
const specifiedItem = entryData.find((e) => e.id === itemId);
|
||||
|
||||
if (specifiedItem) {
|
||||
entryData = entryData.filter((entry) => entry.id !== specifiedItem.id);
|
||||
entryData.unshift(specifiedItem);
|
||||
} else {
|
||||
const itemReq = await fetch(`/api/mod-queue/${itemType}/${itemId}`);
|
||||
|
||||
if (!itemReq.ok) {
|
||||
@ -171,6 +177,7 @@ export default function () {
|
||||
entryData.unshift(itemData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!entryData.length) return;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user