mirror of
https://github.com/immich-app/immich.git
synced 2024-11-15 18:08:48 -07:00
fix(server): sync issue when delete remotes assets (#9479)
This commit is contained in:
parent
f01cf63c70
commit
f28b4e7c99
@ -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> {
|
||||
|
Loading…
Reference in New Issue
Block a user