mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-06 15:42:52 +01:00
feat: DELETE /api/v3/chats/:roomId/users and DELETE /api/v3/chats/:roomId/users/:uid
This commit is contained in:
@@ -101,3 +101,15 @@ chatsAPI.invite = async (caller, data) => {
|
||||
delete data.uids;
|
||||
return chatsAPI.users(caller, data);
|
||||
};
|
||||
|
||||
chatsAPI.kick = async (caller, data) => {
|
||||
const uidsExist = await user.exists(data.uids);
|
||||
if (!uidsExist.every(Boolean)) {
|
||||
throw new Error('[[error:no-user]]');
|
||||
}
|
||||
|
||||
await messaging.removeUsersFromRoom(caller.uid, data.uids, data.roomId);
|
||||
|
||||
delete data.uids;
|
||||
return chatsAPI.users(caller, data);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user