From 403558535902f15c4f6740d378bde87e58f0328f Mon Sep 17 00:00:00 2001 From: Abhishekfm Date: Wed, 4 Nov 2026 11:36:20 +0530 Subject: [PATCH] Refactor event queries to use publicId instead of slug for event retrieval in GraphQL queries and related components. --- app/[locale]/(user)/events/[eventSlug]/page.tsx | 4 ++-- app/[locale]/(user)/events/queries.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/[locale]/(user)/events/[eventSlug]/page.tsx b/app/[locale]/(user)/events/[eventSlug]/page.tsx index fcdf7462..63a98061 100644 --- a/app/[locale]/(user)/events/[eventSlug]/page.tsx +++ b/app/[locale]/(user)/events/[eventSlug]/page.tsx @@ -23,7 +23,7 @@ export async function generateMetadata({ const result = await GraphQLPublic( eventBySlugQuery, {}, - { slug: eventSlug } + { publicId: eventSlug } ); const event = result.eventBySlug; const title = event?.name?.trim() || 'Event'; @@ -68,7 +68,7 @@ export default async function EventDetailPage({ const result = await GraphQLPublic( eventBySlugQuery, {}, - { slug: eventSlug } + { publicId: eventSlug } ).catch(() => null); const event = result?.eventBySlug; if (!event) notFound(); diff --git a/app/[locale]/(user)/events/queries.ts b/app/[locale]/(user)/events/queries.ts index 3b133ce5..36dca59b 100644 --- a/app/[locale]/(user)/events/queries.ts +++ b/app/[locale]/(user)/events/queries.ts @@ -31,10 +31,10 @@ export type PublicEvent = { export const eventBySlugQuery = operation< { eventBySlug?: PublicEvent | null }, - { slug: string } + { publicId: string } >(` - query EventBySlug($slug: String!) { - eventBySlug(slug: $slug) { + query EventBySlug($publicId: String!) { + eventBySlug(publicId: $publicId) { id name urlSlug