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.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/DevHive.Services/Services/UserService.cs b/src/DevHive.Services/Services/UserService.cs
index 99ac050..22d5052 100644
--- a/src/DevHive.Services/Services/UserService.cs
+++ b/src/DevHive.Services/Services/UserService.cs
@@ -128,7 +128,10 @@ namespace DevHive.Services.Services
User currentUser = await this._userRepository.GetByIdAsync(updateUserServiceModel.Id);
await this.PopulateUserModel(currentUser, updateUserServiceModel);
- await this.CreateRelationToFriends(currentUser, updateUserServiceModel.Friends.ToList());
+ if (updateUserServiceModel.Friends.Count() > 0)
+ await this.CreateRelationToFriends(currentUser, updateUserServiceModel.Friends.ToList());
+ else
+ currentUser.Friends.Clear();
IdentityResult result = await this._userManager.UpdateAsync(currentUser);