diff --git a/pages/mod-queue.page.tsx b/pages/mod-queue.page.tsx
index b6da992..a145910 100644
--- a/pages/mod-queue.page.tsx
+++ b/pages/mod-queue.page.tsx
@@ -4,6 +4,7 @@ import {
Flex,
Select,
useBreakpointValue,
+ useToast,
VStack,
} from "@chakra-ui/react";
import { useEffect, useState } from "react";
@@ -15,11 +16,23 @@ export function Page(pageProps: { [p: string]: any }) {
for (const type of pageProps.entry_types)
entryTypes.push()
- useEffect(() => {
- (async function () {
- const queueRequest = await fetch("/api/mod-queue")
- })();
- }, []);
+ async function updateQueue(queue_type: string, include_closed: boolean = false): Promise {
+ const queueReq = await fetch(`/api/mod-queue/list?type=${queue_type}&includeClosed=${include_closed}`);
+
+ if (!queueReq.ok) {
+ const errorData: { error: string } = await queueReq.json();
+
+ useToast()({
+ description: errorData.error,
+ duration: 10000,
+ isClosable: true,
+ status: "error",
+ title: "Failed to load queue",
+ });
+
+ return;
+ }
+ }
return (