fix(server): sync issue when delete remotes assets (#9479)

This commit is contained in:
Alex 2024-05-14 11:51:15 -05:00 committed by GitHub
parent f01cf63c70
commit f28b4e7c99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,8 +10,8 @@ import { In, LessThan, MoreThan, Repository } from 'typeorm';
export class AuditRepository implements IAuditRepository {
constructor(@InjectRepository(AuditEntity) private repository: Repository<AuditEntity>) {}
getAfter(since: Date, options: AuditSearch): Promise<string[]> {
return this.repository
async getAfter(since: Date, options: AuditSearch): Promise<string[]> {
const records = await this.repository
.createQueryBuilder('audit')
.where({
createdAt: MoreThan(since),
@ -22,7 +22,9 @@ export class AuditRepository implements IAuditRepository {
.distinctOn(['audit.entityId', 'audit.entityType'])
.orderBy('audit.entityId, audit.entityType, audit.createdAt', 'DESC')
.select('audit.entityId')
.getRawMany();
.getMany();
return records.map((r) => r.entityId);
}
async removeBefore(before: Date): Promise<void> {