diff options
| author | transtrike <transtrike@gmail.com> | 2021-01-17 12:24:17 +0200 |
|---|---|---|
| committer | transtrike <transtrike@gmail.com> | 2021-01-17 12:24:17 +0200 |
| commit | c43a7665b9febe890eb6dac143b62c36464cc94d (patch) | |
| tree | f016e79627d0074ccf6f6456c80a91c0410c191f /src/DevHive.Services/Services/UserService.cs | |
| parent | e037d611c7ba00d0126a8f954cdc56d7bfeb979e (diff) | |
| download | DevHive-c43a7665b9febe890eb6dac143b62c36464cc94d.tar DevHive-c43a7665b9febe890eb6dac143b62c36464cc94d.tar.gz DevHive-c43a7665b9febe890eb6dac143b62c36464cc94d.zip | |
Moved Lang&Tech CRUD to Update in User Layer
Diffstat (limited to 'src/DevHive.Services/Services/UserService.cs')
| -rw-r--r-- | src/DevHive.Services/Services/UserService.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/DevHive.Services/Services/UserService.cs b/src/DevHive.Services/Services/UserService.cs index 37dbc7b..d9e87e0 100644 --- a/src/DevHive.Services/Services/UserService.cs +++ b/src/DevHive.Services/Services/UserService.cs @@ -160,12 +160,12 @@ namespace DevHive.Services.Services return this._userMapper.Map<UserServiceModel>(user); } - public async Task<UserServiceModel> GetFriendById(Guid friendId) + public async Task<UserServiceModel> GetFriend(string username) { - if (!await _userRepository.DoesUserExistAsync(friendId)) - throw new ArgumentException("User does not exist!"); + User friend = await this._userRepository.GetByUsernameAsync(username); - User friend = await this._userRepository.GetByIdAsync(friendId); + if (default(User) == friend) + throw new ArgumentException("User does not exist!"); return this._userMapper.Map<UserServiceModel>(friend); } |
