mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 03:04:16 -04:00
fix: don't show comments or likes for trashed assets (#19113)
This commit is contained in:
parent
bedcf50196
commit
5dd3a6e13f
@ -23,9 +23,9 @@ from
|
||||
) as "dummy"
|
||||
) as "user" on true
|
||||
left join "assets" on "assets"."id" = "activity"."assetId"
|
||||
and "assets"."deletedAt" is null
|
||||
where
|
||||
"activity"."albumId" = $1
|
||||
and "assets"."deletedAt" is null
|
||||
order by
|
||||
"activity"."createdAt" asc
|
||||
|
||||
|
@ -36,12 +36,13 @@ export class ActivityRepository {
|
||||
(join) => join.onTrue(),
|
||||
)
|
||||
.select((eb) => eb.fn.toJson('user').as('user'))
|
||||
.leftJoin('assets', (join) => join.onRef('assets.id', '=', 'activity.assetId').on('assets.deletedAt', 'is', null))
|
||||
.leftJoin('assets', 'assets.id', 'activity.assetId')
|
||||
.$if(!!userId, (qb) => qb.where('activity.userId', '=', userId!))
|
||||
.$if(assetId === null, (qb) => qb.where('assetId', 'is', null))
|
||||
.$if(!!assetId, (qb) => qb.where('activity.assetId', '=', assetId!))
|
||||
.$if(!!albumId, (qb) => qb.where('activity.albumId', '=', albumId!))
|
||||
.$if(isLiked !== undefined, (qb) => qb.where('activity.isLiked', '=', isLiked!))
|
||||
.where('assets.deletedAt', 'is', null)
|
||||
.orderBy('activity.createdAt', 'asc')
|
||||
.execute();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user