mirror of
https://github.com/bitwarden/server.git
synced 2025-07-18 16:11:28 -05:00
Added API for getting the current user's account revision date
This commit is contained in:
@ -7,5 +7,6 @@ namespace Bit.Core.Repositories
|
||||
public interface IUserRepository : IRepository<User, Guid>
|
||||
{
|
||||
Task<User> GetByEmailAsync(string email);
|
||||
Task<DateTime> GetAccountRevisionDateAsync(Guid id);
|
||||
}
|
||||
}
|
||||
|
@ -36,6 +36,19 @@ namespace Bit.Core.Repositories.SqlServer
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<DateTime> GetAccountRevisionDateAsync(Guid id)
|
||||
{
|
||||
using(var connection = new SqlConnection(ConnectionString))
|
||||
{
|
||||
var results = await connection.QueryAsync<DateTime>(
|
||||
$"[{Schema}].[{Table}_ReadAccountRevisionDateById]",
|
||||
new { Id = id },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
|
||||
return results.SingleOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
public override async Task ReplaceAsync(User user)
|
||||
{
|
||||
await base.ReplaceAsync(user);
|
||||
|
Reference in New Issue
Block a user