api: remove profile from user settings

This commit is contained in:
Abdullah Atta
2024-05-16 13:13:06 +05:00
parent 98b5143bfe
commit 1c901aad84
4 changed files with 2 additions and 13 deletions
@@ -78,9 +78,6 @@ namespace Notesnook.API.Controllers
if (user.AttachmentsKey != null)
await UserService.SetUserAttachmentsKeyAsync(response.UserId, user.AttachmentsKey);
else if (user.Profile != null)
await UserService.SetUserProfileAsync(response.UserId, user.Profile);
else return BadRequest();
return Ok();
}
-1
View File
@@ -31,6 +31,5 @@ namespace Notesnook.API.Interfaces
Task<bool> ResetUserAsync(string userId, bool removeAttachments);
Task<UserResponse> GetUserAsync(bool repair = true);
Task SetUserAttachmentsKeyAsync(string userId, IEncrypted key);
Task SetUserProfileAsync(string userId, IEncrypted profile);
}
}
-1
View File
@@ -34,7 +34,6 @@ namespace Notesnook.API.Models
public string Salt { get; set; }
public EncryptedData VaultKey { get; set; }
public EncryptedData AttachmentsKey { get; set; }
public EncryptedData Profile { get; set; }
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
+2 -8
View File
@@ -18,7 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.IO;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
@@ -154,7 +156,6 @@ namespace Notesnook.API.Services
response.AttachmentsKey = userSettings.AttachmentsKey;
response.Salt = userSettings.Salt;
response.Subscription = subscription;
response.Profile = userSettings.Profile;
return response;
}
@@ -165,13 +166,6 @@ namespace Notesnook.API.Services
await Repositories.UsersSettings.UpdateAsync(userSettings.Id, userSettings);
}
public async Task SetUserProfileAsync(string userId, IEncrypted profile)
{
var userSettings = await Repositories.UsersSettings.FindOneAsync((u) => u.UserId == userId);
userSettings.Profile = (EncryptedData)profile;
await Repositories.UsersSettings.UpdateAsync(userSettings.Id, userSettings);
}
public async Task<bool> DeleteUserAsync(string userId, string jti)
{
try