mirror of
https://github.com/bitwarden/server.git
synced 2025-02-16 01:51:21 +01:00
change revision date API to query only for data needed
This commit is contained in:
parent
972d630c24
commit
3a31654828
@ -164,9 +164,7 @@ namespace Bit.Api.Controllers
|
||||
public async Task<ProfileResponseModel> PutProfile([FromBody]UpdateProfileRequestModel model)
|
||||
{
|
||||
var user = await _userService.GetUserByPrincipalAsync(User);
|
||||
|
||||
await _userService.SaveUserAsync(model.ToUser(user));
|
||||
|
||||
var response = new ProfileResponseModel(user);
|
||||
return response;
|
||||
}
|
||||
@ -174,16 +172,15 @@ namespace Bit.Api.Controllers
|
||||
[HttpGet("revision-date")]
|
||||
public async Task<long?> GetAccountRevisionDate()
|
||||
{
|
||||
//var userId = _userService.GetProperUserId(User);
|
||||
//long? revisionDate = null;
|
||||
//if(userId.HasValue)
|
||||
//{
|
||||
// var date = await _userService.GetAccountRevisionDateByIdAsync(userId.Value);
|
||||
// revisionDate = Core.Utilities.CoreHelpers.EpocMilliseconds(date);
|
||||
//}
|
||||
var userId = _userService.GetProperUserId(User);
|
||||
long? revisionDate = null;
|
||||
if(userId.HasValue)
|
||||
{
|
||||
var date = await _userService.GetAccountRevisionDateByIdAsync(userId.Value);
|
||||
revisionDate = Core.Utilities.CoreHelpers.EpocMilliseconds(date);
|
||||
}
|
||||
|
||||
var user = await _userService.GetUserByPrincipalAsync(User);
|
||||
return Core.Utilities.CoreHelpers.EpocMilliseconds(user.AccountRevisionDate);
|
||||
return revisionDate;
|
||||
}
|
||||
|
||||
[HttpGet("two-factor")]
|
||||
|
Loading…
Reference in New Issue
Block a user