fix(server): cannot render album page when all assets of an album are in trash (#15690)

* fix(server): cannot render album page when all assets of an album are in trash

* inner join

* add e2e test

* check empty albums too

* render add to album button on empty album

* lint

* count 0 if undefined

* fix album card test

---------

Co-authored-by: mertalev <101130780+mertalev@users.noreply.github.com>
This commit is contained in:
Alex 2025-01-26 21:18:34 -06:00 committed by GitHub
parent 8dab5d3798
commit f6cbc9db06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 91 additions and 58 deletions

View file

@ -207,8 +207,8 @@ select
count("assets"."id")::int as "assetCount"
from
"albums"
left join "albums_assets_assets" as "album_assets" on "album_assets"."albumsId" = "albums"."id"
left join "assets" on "assets"."id" = "album_assets"."assetsId"
inner join "albums_assets_assets" as "album_assets" on "album_assets"."albumsId" = "albums"."id"
inner join "assets" on "assets"."id" = "album_assets"."assetsId"
where
"albums"."id" in ($1)
and "assets"."deletedAt" is null