feat: DELETE /api/v3/chats/:roomId/users and DELETE /api/v3/chats/:roomId/users/:uid

This commit is contained in:
Julian Lam
2021-12-22 09:58:52 -05:00
parent 6294beea0b
commit fe17c94c35
9 changed files with 121 additions and 19 deletions

View File

@@ -264,16 +264,9 @@ define('forum/chats', [
modal.on('click', '[data-action="kick"]', function () {
const uid = parseInt(this.getAttribute('data-uid'), 10);
socket.emit('modules.chats.removeUserFromRoom', {
roomId: roomId,
uid: uid,
}, function (err) {
if (err) {
return alerts.error(err);
}
Chats.refreshParticipantsList(roomId, modal);
});
api.delete(`/chats/${roomId}/users/${uid}`, {}).then((body) => {
Chats.refreshParticipantsList(roomId, modal, body);
}).catch(alerts.error);
});
};