admin/services/eventGuestListAccess.ts
alisaza 82593dc18c refactor(events): update event management components and remove unused files
- Replaced `LIST_PUBLIC_CATEGORIES` with `LIST_ADMIN_CATEGORIES_FLAT` in `ArticleFormModal.tsx`.
- Removed the "Add Event" button from the dashboard page.
- Simplified the `EventsPage` by removing the button and adjusting the layout.
- Cleaned up the `AdminEventEditPage` by removing unnecessary props.
- Deleted unused layout and page files related to event creation.
- Updated `AdminAuthContent` to use `useAdminCitiesQuery` instead of `useDiscoveryCitiesQuery`.
- Refactored `EventGuestListAccessPanel` to remove the `accessMode` prop and adjust API calls accordingly.
- Removed several unused components and tests related to event creation, enhancing project maintainability.
2026-09-07 18:09:55 +03:30

23 lines
1.0 KiB
TypeScript

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<EventGuestListLink[]> {
const response = await adminEventExtrasApi.adminEventGuestListLinksControllerList(eventId)
const payload = unwrapApiPayload<EventGuestListLink[]>(response.data)
return Array.isArray(payload) ? payload : []
}
export async function fetchEventInvitedGuests(eventId: string): Promise<EventInvitedGuest[]> {
const response = await adminEventExtrasApi.adminEventInvitedGuestsControllerGet(eventId)
const payload = unwrapApiPayload<EventInvitedGuest[]>(response.data)
return Array.isArray(payload) ? payload : []
}