refactor: remove obsolete member management API module
This commit is contained in:
@@ -25,7 +25,7 @@ export default async function EditEventPage({ params }: PageProps) {
|
||||
if (!acct) return <AccountNotFound />;
|
||||
|
||||
const api = createEventManagementApi(client);
|
||||
const event = await api.getEvent(eventId);
|
||||
const event = await api.events.getById(eventId);
|
||||
if (!event) return <AccountNotFound />;
|
||||
|
||||
const e = event as Record<string, unknown>;
|
||||
|
||||
@@ -36,8 +36,8 @@ export default async function EventDetailPage({ params }: PageProps) {
|
||||
const t = await getTranslations('cms.events');
|
||||
|
||||
const [event, registrations] = await Promise.all([
|
||||
api.getEvent(eventId),
|
||||
api.getRegistrations(eventId),
|
||||
api.events.getById(eventId),
|
||||
api.registrations.list(eventId),
|
||||
]);
|
||||
|
||||
if (!event) return <div>{t('notFound')}</div>;
|
||||
|
||||
@@ -29,7 +29,7 @@ export default async function HolidayPassesPage({ params }: PageProps) {
|
||||
if (!acct) return <AccountNotFound />;
|
||||
|
||||
const api = createEventManagementApi(client);
|
||||
const passes = await api.listHolidayPasses(acct.id);
|
||||
const passes = await api.holidayPasses.list(acct.id);
|
||||
|
||||
return (
|
||||
<CmsPageShell account={account} title={t('holidayPasses')}>
|
||||
|
||||
@@ -47,13 +47,13 @@ export default async function EventsPage({ params, searchParams }: PageProps) {
|
||||
|
||||
const page = Number(search.page) || 1;
|
||||
const api = createEventManagementApi(client);
|
||||
const events = await api.listEvents(acct.id, { page });
|
||||
const events = await api.events.list(acct.id, { page });
|
||||
|
||||
// Fetch registration counts for all events on this page
|
||||
const eventIds = events.data.map((eventItem: Record<string, unknown>) =>
|
||||
String(eventItem.id),
|
||||
);
|
||||
const registrationCounts = await api.getRegistrationCounts(eventIds);
|
||||
const registrationCounts = await api.events.getRegistrationCounts(eventIds);
|
||||
|
||||
// Pre-compute stats before rendering
|
||||
const uniqueLocationCount = new Set(
|
||||
|
||||
@@ -36,12 +36,12 @@ export default async function EventRegistrationsPage({ params }: PageProps) {
|
||||
if (!acct) return <AccountNotFound />;
|
||||
|
||||
const api = createEventManagementApi(client);
|
||||
const events = await api.listEvents(acct.id, { page: 1 });
|
||||
const events = await api.events.list(acct.id, { page: 1 });
|
||||
|
||||
// Load registrations for each event in parallel
|
||||
const eventsWithRegistrations = await Promise.all(
|
||||
events.data.map(async (event: Record<string, unknown>) => {
|
||||
const registrations = await api.getRegistrations(String(event.id));
|
||||
const registrations = await api.registrations.list(String(event.id));
|
||||
return {
|
||||
id: String(event.id),
|
||||
name: String(event.name),
|
||||
|
||||
Reference in New Issue
Block a user