diff --git a/app/(admin)/admin/booking/[id]/page.tsx b/app/(admin)/admin/booking/[id]/page.tsx index 03c1075..cc4e38d 100644 --- a/app/(admin)/admin/booking/[id]/page.tsx +++ b/app/(admin)/admin/booking/[id]/page.tsx @@ -695,11 +695,14 @@ export default function AppointmentDetailPage() {
{(() => { - const canJoin = appointment.can_join_as_moderator === true || appointment.can_join_as_moderator === "true"; + // Check if can join as moderator (handle both boolean and string values) + const canJoinAsModerator = appointment.can_join_as_moderator === true || appointment.can_join_as_moderator === "true"; + // Check if meeting has started (handle both field names) const startedAt = appointment.started_at || appointment.meeting_started_at; const hasStarted = startedAt != null && startedAt !== ""; - if (!canJoin) { + // If can_join_as_moderator != true, display "Meeting Not Available" + if (!canJoinAsModerator) { return ( - )} + {(() => { + // Check if can join as participant (handle both boolean and string values) + const canJoinAsParticipant = appointment.can_join_as_participant === true || appointment.can_join_as_participant === "true"; + // Check if meeting has started (handle both field names) + const startedAt = appointment.started_at || appointment.meeting_started_at; + const hasStarted = startedAt != null && startedAt !== ""; + + // If can_join_as_participant != true, display "Meeting Not Available" + if (!canJoinAsParticipant) { + return ( + + ); + } + + // If can_join_as_participant == true && started_at != null, show "Join Now" button + if (hasStarted) { + return ( + + + ); + } + + // If can_join_as_participant == true && started_at == null, show "Meeting Not Available" + return ( + + ); + })()}
)} diff --git a/lib/api_urls.ts b/lib/api_urls.ts index aa36240..ee28760 100644 --- a/lib/api_urls.ts +++ b/lib/api_urls.ts @@ -30,7 +30,6 @@ export const API_ENDPOINTS = { checkDateAvailability: `${API_BASE_URL}/meetings/availability/check/`, availabilityOverview: `${API_BASE_URL}/meetings/availability/overview/`, startMeeting: (id: string) => `${API_BASE_URL}/meetings/appointments/${id}/start/`, - endMeeting: (id: string) => `${API_BASE_URL}/meetings/appointments/${id}/end/`, }, } as const;