use findById
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2022-10-27 09:27:50 +02:00
parent 3ffc098b56
commit 5c65314162
1 changed files with 1 additions and 4 deletions

View File

@ -44,16 +44,13 @@ module.exports = Self => {
if (!user.hasGrant)
throw new UserError(`You don't have grant privilege`);
const [userToUpdate] = await models.Account.find({
const userToUpdate = await models.Account.findById(id, {
fields: ['id', 'name', 'hasGrant', 'roleFk', 'password'],
include: {
relation: 'role',
scope: {
fields: ['name']
}
},
where: {
id: id
}
}, myOptions);