fix: socket user bans

v1.18.x
Julian Lam 4 years ago
parent 14f9d8b0e5
commit 3f347baadb

@ -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)));
}

@ -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);
}));
};

Loading…
Cancel
Save