mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-02-12 11:12:44 +00:00
api: fix error on user patch
This commit is contained in:
@@ -69,17 +69,11 @@ namespace Notesnook.API.Controllers
|
||||
}
|
||||
|
||||
[HttpPatch]
|
||||
public async Task<IActionResult> UpdateUser([FromBody] UserResponse user)
|
||||
public async Task<IActionResult> 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();
|
||||
}
|
||||
|
||||
@@ -19,16 +19,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user