import type { GuestListLinkResponseDto, InvitedGuestResponseDto } from '@/api/generated/models' import { getAdminEventExtras } from '@/api/generated/admin-event-extras/admin-event-extras' import { unwrapApiPayload } from '@/helpers/listResponse' export type EventGuestListLink = GuestListLinkResponseDto export type EventInvitedGuest = InvitedGuestResponseDto const adminEventExtrasApi = getAdminEventExtras() export async function fetchEventGuestListLinks(eventId: string): Promise { const response = await adminEventExtrasApi.adminEventGuestListLinksControllerList(eventId) const payload = unwrapApiPayload(response.data) return Array.isArray(payload) ? payload : [] } export async function fetchEventInvitedGuests(eventId: string): Promise { const response = await adminEventExtrasApi.adminEventInvitedGuestsControllerGet(eventId) const payload = unwrapApiPayload(response.data) return Array.isArray(payload) ? payload : [] }