diff options
| author | transtrike <transtrike@gmail.com> | 2020-12-11 09:27:06 +0200 |
|---|---|---|
| committer | transtrike <transtrike@gmail.com> | 2020-12-11 09:27:06 +0200 |
| commit | 9b9647e883fa843092b55a086fce8f3c844a13b0 (patch) | |
| tree | f40e925d45451e07b813d6cb76a3dbe823b7a40d /API/Service/UserService.cs | |
| parent | e744263581ae7050012397e48aa3316d0f21bb9b (diff) | |
| download | DevHive-9b9647e883fa843092b55a086fce8f3c844a13b0.tar DevHive-9b9647e883fa843092b55a086fce8f3c844a13b0.tar.gz DevHive-9b9647e883fa843092b55a086fce8f3c844a13b0.zip | |
Fixed Task<bool> to bool issues
Diffstat (limited to 'API/Service/UserService.cs')
| -rw-r--r-- | API/Service/UserService.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/API/Service/UserService.cs b/API/Service/UserService.cs index 632e96d..931010e 100644 --- a/API/Service/UserService.cs +++ b/API/Service/UserService.cs @@ -22,7 +22,7 @@ namespace API.Service public async Task<HttpStatusCode> CreateUser(UserDTO userDTO) { - if(this._userDbRepository.DoesUsernameExist(userDTO.UserName)) + if(await this._userDbRepository.DoesUsernameExist(userDTO.UserName)) return HttpStatusCode.Forbidden; User user = this._userMapper.Map<User>(userDTO); @@ -41,10 +41,10 @@ namespace API.Service public async Task<HttpStatusCode> UpdateUser(int id, UserDTO userDTO) { - if (!this._userDbRepository.DoesUserExist(id)) + if (!await this._userDbRepository.DoesUserExist(id)) return HttpStatusCode.NotFound; - if(this._userDbRepository.DoesUsernameExist(userDTO.UserName)) + if(await this._userDbRepository.DoesUsernameExist(userDTO.UserName)) return HttpStatusCode.Forbidden; User user = this._userMapper.Map<User>(userDTO); @@ -55,7 +55,7 @@ namespace API.Service public async Task<HttpStatusCode> DeleteUser(int id) { - if (!this._userDbRepository.DoesUserExist(id)) + if (!await this._userDbRepository.DoesUserExist(id)) return HttpStatusCode.Forbidden; await this._userDbRepository.DeleteAsync(id); |
