Renamed function to better reflect it's function

ref #39
This commit is contained in:
Nicolai Ort 2020-12-20 17:17:30 +01:00
parent 14b6651f96
commit 3850bd9681
2 changed files with 2 additions and 2 deletions

View File

@ -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'] }));
}

View File

@ -85,7 +85,7 @@ export class UpdateUser {
/**
* Creates a User entity from this.
*/
public async toUser(user: User): Promise<User> {
public async updateUser(user: User): Promise<User> {
user.email = this.email;
user.username = this.username;
if (user.email === undefined && user.username === undefined) {