Extract admin dashboard from ghabilee-frontend2 into a dedicated Next.js app for backoffice.ghabilee.ir (no SEO indexing / Clarity).
20 lines
760 B
TypeScript
20 lines
760 B
TypeScript
import axiosInstance from '@/config/axios'
|
|
import { unwrapApiPayload } from '@/helpers/listResponse'
|
|
|
|
export interface EventViewerState {
|
|
isOwner: boolean
|
|
isBookmarked: boolean
|
|
isFollowingOrganizer: boolean
|
|
activeBooking: { id: string; status: 'pending_payment' | 'confirmed' } | null
|
|
waitlistEntry: { id: string; status: 'waiting' | 'notified' | 'accepted' } | null
|
|
exactLocation: { address: string; lat: number; lng: number } | null
|
|
canJoinAudience: boolean
|
|
audienceBlockReasons: ('gender' | 'age' | 'city')[]
|
|
}
|
|
|
|
export async function fetchEventViewerState(eventId: string): Promise<EventViewerState> {
|
|
const response = await axiosInstance.get(`events/${eventId}/viewer-state`)
|
|
|
|
return unwrapApiPayload<EventViewerState>(response.data)
|
|
}
|