diff --git a/app/frontend/src/mocks/mogaco.ts b/app/frontend/src/mocks/mogaco.ts index b1846c35f..8803ac0aa 100644 --- a/app/frontend/src/mocks/mogaco.ts +++ b/app/frontend/src/mocks/mogaco.ts @@ -67,6 +67,23 @@ export const mogacoAPIHandlers = [ http.get('/mogaco/:id/participants', ({ params: { id } }) => HttpResponse.json(participantsList[Number(id) - 1]), ), - http.post('mogaco/:id/join', () => {}), - http.delete('mogaco/:id/join', () => {}), + 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); + }, + ), ];