mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(web): display number of likes in asset viewer (#18911)
* feat: display number of likes * fix: properly decrement like count on unlike Co-authored-by: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com> * chore: pr feedback * chore: updated related test * chore: formatter run * chore: force numberOfLikes to null in album context to pass lint * chore: open-api updated * fix: use undefined, not null * styling tweaks * chore: updated sql --------- Co-authored-by: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com> Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
parent
5d0ad853f4
commit
a26d703335
13 changed files with 77 additions and 29 deletions
|
|
@ -62,15 +62,21 @@ where
|
|||
|
||||
-- ActivityRepository.getStatistics
|
||||
select
|
||||
count(*) as "count"
|
||||
count(*) filter (
|
||||
where
|
||||
"activity"."isLiked" = $1
|
||||
) as "comments",
|
||||
count(*) filter (
|
||||
where
|
||||
"activity"."isLiked" = $2
|
||||
) as "likes"
|
||||
from
|
||||
"activity"
|
||||
inner join "users" on "users"."id" = "activity"."userId"
|
||||
and "users"."deletedAt" is null
|
||||
left join "assets" on "assets"."id" = "activity"."assetId"
|
||||
where
|
||||
"activity"."assetId" = $1
|
||||
and "activity"."albumId" = $2
|
||||
and "activity"."isLiked" = $3
|
||||
"activity"."assetId" = $3
|
||||
and "activity"."albumId" = $4
|
||||
and "assets"."deletedAt" is null
|
||||
and "assets"."visibility" != 'locked'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue