refactor: rename eventId to partyEventId in delete API route and test case

This commit is contained in:
louiscklaw
2025-06-15 17:08:36 +08:00
parent 843e459527
commit 816d88c2c1
2 changed files with 5 additions and 5 deletions

View File

@@ -9,13 +9,13 @@ import { deleteEvent } from 'src/app/services/party-event.service';
*************************************** */ *************************************** */
export async function PATCH(req: NextRequest) { export async function PATCH(req: NextRequest) {
try { try {
const { eventId } = await req.json(); const { partyEventId } = await req.json();
if (!eventId) throw new Error('eventId cannot be null'); if (!partyEventId) throw new Error('partyEventId cannot be null');
await deleteEvent(eventId); await deleteEvent(partyEventId);
return response({ eventId }, STATUS.OK); return response({ partyEventId }, STATUS.OK);
} catch (error) { } catch (error) {
return handleError('PartyEvent - Delete', error); return handleError('PartyEvent - Delete', error);
} }

View File

@@ -4,5 +4,5 @@ PATCH http://localhost:7272/api/party-event/delete
Content-Type: application/json Content-Type: application/json
{ {
"eventId": "e99f09a7-dd88-49d5-b1c8-1daf80c2d7b01" "partyEventId": "e99f09a7-dd88-49d5-b1c8-1daf80c2d7b01"
} }