use findById
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
3ffc098b56
commit
5c65314162
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue