diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-02-05 20:15:50 +0200 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-02-05 20:15:50 +0200 |
| commit | 053e5c5494de86b1b114dcb1e1d5245a11472a19 (patch) | |
| tree | ae9ba1469d003dafb72420840233e36d25d14eff /src | |
| parent | e6cb176c837a1e6a1a849376bfa968b12928fb2e (diff) | |
| download | DevHive-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.cs | 5 |
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); |
