aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2021-02-05 20:15:50 +0200
committerSyndamia <kamen.d.mladenov@protonmail.com>2021-02-05 20:15:50 +0200
commit053e5c5494de86b1b114dcb1e1d5245a11472a19 (patch)
treeae9ba1469d003dafb72420840233e36d25d14eff /src
parente6cb176c837a1e6a1a849376bfa968b12928fb2e (diff)
downloadDevHive-053e5c5494de86b1b114dcb1e1d5245a11472a19.tar
DevHive-053e5c5494de86b1b114dcb1e1d5245a11472a19.tar.gz
DevHive-053e5c5494de86b1b114dcb1e1d5245a11472a19.zip
Added a workaround for removing all friends
Diffstat (limited to 'src')
-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);