Overview
useRemoveHost returns a callable that removes a user from an event’s hostIds. It sends DELETE /events/:eventId/hosts/:userId, with the host in the path and no body.
- Removing another host is owner-only: the logged-in user must be the event’s owner, and, for an event in a space, an active member of that space who isn’t banned in it or a space above it (
403 event/not-space-member otherwise). Other hosts get 403 event/forbidden.
- Stepping down (
userId is the logged-in user): any host other than the owner may step down, active member of the event’s space or not. The owner is always one of the event’s hosts and can’t step down or be removed (409 event/owner-is-host).
- On an event whose owner’s account was deleted, nobody can remove another host, and its last remaining host can’t step down (
409 event/last-host); they can cancel the event instead.
Usage Example
Parameters
The host to remove, or the logged-in user to step down.
Returns
Returns a Promise<RemoveHostResponse>: the Event with the new hostIds, or, after stepping down from an event the logged-in user can no longer see, only { id }.
See Also