mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-13 12:17:24 +00:00
a269160f6f
Introduce a new feature that lets a user promote one of the authenticated participants of the meeting to a role with additional privileges. Known limitations: * Only authenticated participants can be promoted, but there is no visual indicator yet distinguishing authenticated from anonymous participants. This will be added in a follow-up commit. * The resource_access data fetched in the initial API call becomes stale after a promotion. It is not currently used in the product, so this is not visible, but it should either be refreshed later or removed from the initial fetch. * Demoting a promoted user turns them into a member, which is still a privileged role. This is a deliberate choice until we introduce finer-grained tuning of participant roles.
21 lines
519 B
TypeScript
21 lines
519 B
TypeScript
import { useRoomData } from '../livekit/hooks/useRoomData'
|
|
import { fetchApi } from '@/api/fetchApi'
|
|
|
|
export const useRemoveParticipant = () => {
|
|
const data = useRoomData()
|
|
|
|
const removeParticipant = async (identity: string) => {
|
|
if (!data?.id) {
|
|
throw new Error('Room id is not available')
|
|
}
|
|
|
|
return fetchApi(`rooms/${data.id}/remove-participant/`, {
|
|
method: 'POST',
|
|
body: JSON.stringify({
|
|
participant_identity: identity,
|
|
}),
|
|
})
|
|
}
|
|
return { removeParticipant }
|
|
}
|