refactor: rename eventId to partyEventId in delete API route and test case
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
@@ -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"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user