api: remove profile from user settings
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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)]
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user