diff --git a/Notesnook.API/Controllers/UsersController.cs b/Notesnook.API/Controllers/UsersController.cs index da50886..797c8d7 100644 --- a/Notesnook.API/Controllers/UsersController.cs +++ b/Notesnook.API/Controllers/UsersController.cs @@ -69,17 +69,11 @@ namespace Notesnook.API.Controllers } [HttpPatch] - public async Task UpdateUser([FromBody] UserResponse user) + public async Task UpdateUser([FromBody] UserKeys keys) { var userId = User.FindFirstValue("sub"); try { - var keys = new UserKeys - { - AttachmentsKey = user.AttachmentsKey, - MonographPasswordsKey = user.MonographPasswordsKey, - InboxKeys = user.InboxKeys - }; await UserService.SetUserKeysAsync(userId, keys); return Ok(); } diff --git a/Notesnook.API/Models/UserKeys.cs b/Notesnook.API/Models/UserKeys.cs index 62b5730..62d07c9 100644 --- a/Notesnook.API/Models/UserKeys.cs +++ b/Notesnook.API/Models/UserKeys.cs @@ -19,16 +19,16 @@ along with this program. If not, see . namespace Notesnook.API.Models { - public class UserKeys - { - public EncryptedData AttachmentsKey { get; set; } - public EncryptedData MonographPasswordsKey { get; set; } - public InboxKeys InboxKeys { get; set; } - } + public class UserKeys + { + public EncryptedData? AttachmentsKey { get; set; } + public EncryptedData? MonographPasswordsKey { get; set; } + public InboxKeys? InboxKeys { get; set; } + } - public class InboxKeys - { - public string Public { get; set; } - public EncryptedData Private { get; set; } - } + public class InboxKeys + { + public string? Public { get; set; } + public EncryptedData? Private { get; set; } + } }