Fix users
This commit is contained in:
parent
609a099d0b
commit
5328313004
@ -105,13 +105,12 @@ export default class UsersController extends ApiController {
|
||||
|
||||
//init IUser resource with request body values
|
||||
const userEntity = User.hydrate<User>(req.body);
|
||||
const userFoundEntity = User.hydrate<User>(userFound, { strategy: "excludeAll" });
|
||||
|
||||
//validate user
|
||||
await validateOrReject(userEntity, { groups: ["updateUser"] });
|
||||
|
||||
//call service to get prisma entity
|
||||
const userEntityUpdated = await this.usersService.update(uid, userFoundEntity);
|
||||
const userEntityUpdated = await this.usersService.update(uid, userEntity);
|
||||
|
||||
//Hydrate ressource with prisma entity
|
||||
const user = User.hydrate<User>(userEntityUpdated, {
|
||||
|
Loading…
x
Reference in New Issue
Block a user