mirror of
https://github.com/strapi/strapi.git
synced 2025-12-04 19:13:20 +00:00
Fix manage user role bookshelf
This commit is contained in:
parent
8d6cace469
commit
f471a98f90
@ -216,9 +216,8 @@ module.exports = {
|
||||
const currentUsers = await strapi.query('user', 'users-permissions').find(strapi.utils.models.convertParams('user', {
|
||||
role: roleId
|
||||
}));
|
||||
|
||||
const userToAdd = _.differenceBy(body.users, currentUsers, 'id');
|
||||
const userToRemove = _.differenceBy(currentUsers, body.users, 'id');
|
||||
const userToAdd = _.differenceBy(body.users, currentUsers.toJSON ? currentUsers.toJSON() : currentUsers, 'id');
|
||||
const userToRemove = _.differenceBy(currentUsers.toJSON ? currentUsers.toJSON() : currentUsers, body.users, 'id');
|
||||
|
||||
_.forEach(userToAdd, (user) => {
|
||||
Service.updateUserRole(user, roleId);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user