diff --git a/src/components/dashboard/Officer_EventRequestForm.astro b/src/components/dashboard/Officer_EventRequestForm.astro index 3b010b1..45bd1cb 100644 --- a/src/components/dashboard/Officer_EventRequestForm.astro +++ b/src/components/dashboard/Officer_EventRequestForm.astro @@ -2,6 +2,7 @@ import { Authentication } from "../../scripts/pocketbase/Authentication"; import { Update } from "../../scripts/pocketbase/Update"; import { FileManager } from "../../scripts/pocketbase/FileManager"; +import { Get } from "../../scripts/pocketbase/Get"; // Form sections import PRSection from "./Officer_EventRequestForm/PRSection"; @@ -9,9 +10,48 @@ import EventDetailsSection from "./Officer_EventRequestForm/EventDetailsSection" import TAPSection from "./Officer_EventRequestForm/TAPSection"; import ASFundingSection from "./Officer_EventRequestForm/ASFundingSection"; +interface EventRequest { + id: string; + created: string; + event_name: string; + event_description: string; + location: string; + start_date: string; + end_date: string; + status: 'draft' | 'pending' | 'approved' | 'rejected'; + has_food: boolean; + [key: string]: any; // For other fields we might need +} + +interface ListResponse { + page: number; + perPage: number; + totalItems: number; + totalPages: number; + items: T[]; +} + const auth = Authentication.getInstance(); const update = Update.getInstance(); const fileManager = FileManager.getInstance(); +const get = Get.getInstance(); + +// Get user's submitted event requests +let userEventRequests: ListResponse = { + page: 1, + perPage: 50, + totalItems: 0, + totalPages: 0, + items: [] +}; + +if (auth.isAuthenticated()) { + try { + userEventRequests = await get.getList("event_request", 1, 50, `requested_user = "${auth.getUserId()}"`, "-created"); + } catch (error) { + console.error("Failed to fetch event requests:", error); + } +} ---
@@ -21,91 +61,253 @@ const fileManager = FileManager.getInstance(); Event Request Form -
-
-
-

- Do you need graphics from our design team? -

-
- - +
+ +
+ + + +
+ + +
+ + +
+
+ +
+
+

+ Do you need graphics from our design team? +

+
+ + +
+
+
+ + + +
+ +
+ +
+ + + +
+ +
+ + +
+ +
+ +
- - - -
- -
- -
- - - -
- -
- - -
- +
+ +