refactor: rename product to partyEvent in API route, types and frontend components

This commit is contained in:
louiscklaw
2025-06-15 16:44:27 +08:00
parent 4b64778b59
commit ecdbc45c4a
8 changed files with 50 additions and 43 deletions

View File

@@ -31,23 +31,23 @@ export async function GET(req: NextRequest) {
const { searchParams } = req.nextUrl;
// RULES: eventId must exist
const eventId = searchParams.get('eventId');
if (!eventId) {
return response({ message: 'Event ID is required!' }, STATUS.BAD_REQUEST);
const partyEventId = searchParams.get('partyEventId');
if (!partyEventId) {
return response({ message: 'PartyEvent ID is required!' }, STATUS.BAD_REQUEST);
}
// NOTE: eventId confirmed exist, run below
const event = await getEvent(eventId);
const partyEvent = await getEvent(partyEventId);
if (!event) {
return response({ message: 'Event not found!' }, STATUS.NOT_FOUND);
if (!partyEvent) {
return response({ message: 'PartyEvent not found!' }, STATUS.NOT_FOUND);
}
logger('[PartyEvent] details', event.id);
logger('[PartyEvent] details', partyEvent.id);
createAppLog(L_INFO, 'Get event detail OK', debug);
return response({ event }, STATUS.OK);
return response({ partyEvent }, STATUS.OK);
} catch (error) {
createAppLog(L_ERROR, 'event detail error', debug);

View File

@@ -1,7 +1,7 @@
###
# Get details for a specific party event
GET http://localhost:7272/api/party-event/details?eventId=e99f09a7-dd88-49d5-b1c8-1daf80c2d7b01
GET http://localhost:7272/api/party-event/details?partyEventId=e99f09a7-dd88-49d5-b1c8-1daf80c2d7b01
###