mirror of
https://github.com/immich-app/immich.git
synced 2026-03-07 10:37:22 +03:00
fix(server): activity with deleted assets / users (#9068)
fix: activity with deleted assets / users
This commit is contained in:
@@ -27,6 +27,12 @@ export class ActivityRepository implements IActivityRepository {
|
||||
assetId: assetId === null ? IsNull() : assetId,
|
||||
albumId,
|
||||
isLiked,
|
||||
asset: {
|
||||
deletedAt: IsNull(),
|
||||
},
|
||||
user: {
|
||||
deletedAt: IsNull(),
|
||||
},
|
||||
},
|
||||
relations: {
|
||||
user: true,
|
||||
@@ -48,10 +54,21 @@ export class ActivityRepository implements IActivityRepository {
|
||||
@GenerateSql({ params: [DummyValue.UUID, DummyValue.UUID] })
|
||||
getStatistics(assetId: string, albumId: string): Promise<number> {
|
||||
return this.repository.count({
|
||||
where: { assetId, albumId, isLiked: false },
|
||||
where: {
|
||||
assetId,
|
||||
albumId,
|
||||
isLiked: false,
|
||||
asset: {
|
||||
deletedAt: IsNull(),
|
||||
},
|
||||
user: {
|
||||
deletedAt: IsNull(),
|
||||
},
|
||||
},
|
||||
relations: {
|
||||
user: true,
|
||||
},
|
||||
withDeleted: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user