diff --git a/src/components/dashboard/Officer_EventRequestManagement.astro b/src/components/dashboard/Officer_EventRequestManagement.astro index 8476134..714f9c7 100644 --- a/src/components/dashboard/Officer_EventRequestManagement.astro +++ b/src/components/dashboard/Officer_EventRequestManagement.astro @@ -53,7 +53,7 @@ try { "", "-created", { - expand: ["requested_user"], + expand: "requested_user", } ) .catch((err) => { @@ -308,7 +308,7 @@ try { Collections.EVENT_REQUESTS, "", "-created", - { expand: "requested_user" } + "requested_user" ); } catch (err) { console.error("Error during initial data sync:", err); diff --git a/src/components/dashboard/Officer_EventRequestManagement/EventRequestDetails.tsx b/src/components/dashboard/Officer_EventRequestManagement/EventRequestDetails.tsx index a378ee6..b96855b 100644 --- a/src/components/dashboard/Officer_EventRequestManagement/EventRequestDetails.tsx +++ b/src/components/dashboard/Officer_EventRequestManagement/EventRequestDetails.tsx @@ -7,6 +7,7 @@ import type { EventRequest as SchemaEventRequest } from '../../../schemas/pocket import { FileManager } from '../../../scripts/pocketbase/FileManager'; import { Icon } from "@iconify/react"; import CustomAlert from '../universal/CustomAlert'; +import UniversalFilePreview from '../universal/FilePreview'; import { Authentication } from '../../../scripts/pocketbase/Authentication'; // Extended EventRequest interface with additional properties needed for this component @@ -29,9 +30,9 @@ interface ExtendedEventRequest extends SchemaEventRequest { invoice_files?: string[]; // Array of invoice file IDs flyer_files?: string[]; // Add this for PR-related files files?: string[]; // Generic files field - room_reservation_needed?: boolean; - room_reservation_location?: string; - room_reservation_confirmed?: boolean; + will_or_have_room_booking?: boolean; + room_booking?: string; // Single file for room booking + room_reservation_needed?: boolean; // Keep for backward compatibility additional_notes?: string; } @@ -1503,14 +1504,14 @@ const EventRequestDetails = ({

Room Reservation Needed

-
- {request.room_reservation_needed ? 'Yes' : 'No'} +
+ {request.will_or_have_room_booking ? 'Yes' : 'No'}
- {request.room_reservation_needed ? ( + {request.will_or_have_room_booking ? (

@@ -1519,14 +1520,35 @@ const EventRequestDetails = ({
-

{request.room_reservation_location || 'Not specified'}

+

{request.location || 'Not specified'}

-
- {request.room_reservation_confirmed ? 'Confirmed' : 'Pending'} +
+ {request.room_booking ? 'Booking File Uploaded' : 'No Booking File'}
+ {request.room_booking && ( + + )}
@@ -1617,8 +1639,25 @@ const EventRequestDetails = ({

)} + + {/* File Preview Modal */} + +
+
+ +
+
+
+ +
+
+
+
+ +
+
); }; -export default EventRequestDetails; \ No newline at end of file +export default EventRequestDetails; \ No newline at end of file diff --git a/src/scripts/database/DataSyncService.ts b/src/scripts/database/DataSyncService.ts index 5e59b54..dd485e5 100644 --- a/src/scripts/database/DataSyncService.ts +++ b/src/scripts/database/DataSyncService.ts @@ -154,7 +154,7 @@ export class DataSyncService { } } - // Get data from PocketBase + // Get data from PocketBase with expanded relations const items = await this.get.getAll(collection, filter, sort, { expand: normalizedExpand, });