aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Services/Services/UserService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DevHive.Services/Services/UserService.cs')
-rw-r--r--src/DevHive.Services/Services/UserService.cs8
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);
}