mirror of
https://github.com/suitenumerique/meet.git
synced 2026-09-05 23:26:02 +00:00
wip track the lobby participant not found
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { ApiError } from '@/api/ApiError'
|
||||
import { fetchApi } from '@/api/fetchApi'
|
||||
import { captureEvent } from '@/features/analytics/telemetry'
|
||||
import { useMutation, type UseMutationOptions } from '@tanstack/react-query'
|
||||
|
||||
export interface EnterRoomParams {
|
||||
@@ -17,13 +18,24 @@ export const enterRoom = async ({
|
||||
allowEntry,
|
||||
participantId,
|
||||
}: EnterRoomParams): Promise<EnterRoomResponse> => {
|
||||
return await fetchApi<EnterRoomResponse>(`/rooms/${roomId}/enter/`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
participant_id: participantId,
|
||||
allow_entry: allowEntry,
|
||||
}),
|
||||
})
|
||||
try {
|
||||
return await fetchApi<EnterRoomResponse>(`/rooms/${roomId}/enter/`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
participant_id: participantId,
|
||||
allow_entry: allowEntry,
|
||||
}),
|
||||
})
|
||||
} catch (error) {
|
||||
if (error instanceof ApiError && error.statusCode === 404) {
|
||||
captureEvent('lobby_entry_participant_gone', {
|
||||
room_id: roomId,
|
||||
allow_entry: allowEntry,
|
||||
})
|
||||
return { message: 'participant_gone' }
|
||||
}
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
export function useEnterRoom(
|
||||
|
||||
Reference in New Issue
Block a user