1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 16:42:50 -05:00

[pm-5966] Fix Entity Framework query for MySQL (#5170)

Problem: The Entity Framework query was causing a compile-time error.

Changes:
1. Fixed the query.
2. Renamed the variable to replace the comment.
This commit is contained in:
Jimmy Vo
2025-01-07 10:01:23 -05:00
committed by GitHub
parent 2a6abb928d
commit 0e801ca622
2 changed files with 195 additions and 5 deletions

View File

@ -147,14 +147,13 @@ public class OrganizationDomainRepository : Repository<Core.Entities.Organizatio
using var scope = ServiceScopeFactory.CreateScope();
var dbContext = GetDatabaseContext(scope);
//Get domains that have not been verified after 72 hours
var domains = await dbContext.OrganizationDomains
.Where(x => (DateTime.UtcNow - x.CreationDate).Days == 4
&& x.VerifiedDate == null)
var threeDaysOldUnverifiedDomains = await dbContext.OrganizationDomains
.Where(x => x.CreationDate.Date == DateTime.UtcNow.AddDays(-4).Date
&& x.VerifiedDate == null)
.AsNoTracking()
.ToListAsync();
return Mapper.Map<List<Core.Entities.OrganizationDomain>>(domains);
return Mapper.Map<List<Core.Entities.OrganizationDomain>>(threeDaysOldUnverifiedDomains);
}
public async Task<bool> DeleteExpiredAsync(int expirationPeriod)