Skip to content

Commit

Permalink
fix: socket user bans
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Oct 16, 2020
1 parent 14f9d8b commit 3f347ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/api/users.js
Expand Up @@ -87,7 +87,6 @@ usersAPI.delete = async function (caller, data) {
};

usersAPI.deleteMany = async function (caller, data) {
console.log(data.uids);
if (await canDeleteUids(data.uids)) {
await Promise.all(data.uids.map(uid => processDeletion(uid, caller)));
}
Expand Down
5 changes: 4 additions & 1 deletion src/socket.io/user/ban.js
Expand Up @@ -7,7 +7,10 @@ module.exports = function (SocketUser) {
SocketUser.banUsers = async function (socket, data) {
websockets.warnDeprecated(socket, 'PUT /api/v3/users/:uid/ban');
await Promise.all(data.uids.map(async (uid) => {
await api.users.ban(socket, { uid });
const payload = { ...data };
delete payload.uids;
payload.uid = uid;
await api.users.ban(socket, payload);
}));
};

Expand Down

0 comments on commit 3f347ba

Please sign in to comment.