From 3850bd968173fb2a701ff02327c38a662ee0c40b Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Sun, 20 Dec 2020 17:17:30 +0100 Subject: [PATCH] Renamed function to better reflect it's function ref #39 --- src/controllers/UserController.ts | 2 +- src/models/actions/UpdateUser.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/UserController.ts b/src/controllers/UserController.ts index cdc91af..6a782bf 100644 --- a/src/controllers/UserController.ts +++ b/src/controllers/UserController.ts @@ -84,7 +84,7 @@ export class UserController { if (oldUser.id != updateUser.id) { throw new UserIdsNotMatchingError(); } - await this.userRepository.save(await updateUser.toUser(oldUser)); + await this.userRepository.save(await updateUser.updateUser(oldUser)); return new ResponseUser(await this.userRepository.findOne({ id: id }, { relations: ['permissions', 'groups'] })); } diff --git a/src/models/actions/UpdateUser.ts b/src/models/actions/UpdateUser.ts index abd489a..e50436d 100644 --- a/src/models/actions/UpdateUser.ts +++ b/src/models/actions/UpdateUser.ts @@ -85,7 +85,7 @@ export class UpdateUser { /** * Creates a User entity from this. */ - public async toUser(user: User): Promise { + public async updateUser(user: User): Promise { user.email = this.email; user.username = this.username; if (user.email === undefined && user.username === undefined) {