From 0d1be622c53cd34cbef6293ba4704701916303c8 Mon Sep 17 00:00:00 2001 From: Jiseung Date: Thu, 23 Nov 2023 22:33:14 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=A1=20=EC=B0=B8=EC=84=9D/=EC=B0=B8?= =?UTF-8?q?=EC=84=9D=20=EC=B7=A8=EC=86=8C=20mock=20API=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/frontend/src/mocks/mogaco.ts | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/app/frontend/src/mocks/mogaco.ts b/app/frontend/src/mocks/mogaco.ts index 8803ac0aa..fb4815f22 100644 --- a/app/frontend/src/mocks/mogaco.ts +++ b/app/frontend/src/mocks/mogaco.ts @@ -67,23 +67,15 @@ export const mogacoAPIHandlers = [ http.get('/mogaco/:id/participants', ({ params: { id } }) => HttpResponse.json(participantsList[Number(id) - 1]), ), - http.post<{ id: string }, { memberId: string }>( - 'mogaco/:id/join', - async ({ request, params: { id } }) => { - const { memberId } = await request.json(); - participantsList[Number(id) - 1] = [ - ...participantsList[Number(id) - 1], - userList[Number(memberId) - 1], - ]; - }, - ), - http.delete<{ id: string }, { memberId: string }>( - 'mogaco/:id/join', - async ({ request, params: { id } }) => { - const { memberId } = await request.json(); - participantsList[Number(id) - 1] = participantsList[ - Number(id) - 1 - ].filter((participant) => participant.id !== memberId); - }, - ), + http.post('mogaco/:id/join', async ({ params: { id } }) => { + participantsList[Number(id) - 1] = [ + ...participantsList[Number(id) - 1], + userList[0], + ]; + }), + http.delete('mogaco/:id/join', async ({ params: { id } }) => { + participantsList[Number(id) - 1] = participantsList[Number(id) - 1].filter( + (participant) => participant.id !== userList[0].id, + ); + }), ];