fix(server): query fixes (#15509)

This commit is contained in:
Mert
2025-01-22 15:17:42 -05:00
committed by GitHub
parent 7b882b35e5
commit 49a6961ec6
15 changed files with 275 additions and 165 deletions
+22 -2
View File
@@ -82,11 +82,31 @@ select
where
"shared_links"."albumId" = "albums"."id"
) as agg
) as "sharedLinks"
) as "sharedLinks",
(
select
json_agg("asset") as "assets"
from
(
select
"assets".*,
to_json("exif") as "exifInfo"
from
"assets"
inner join "exif" on "assets"."id" = "exif"."assetId"
inner join "albums_assets_assets" on "albums_assets_assets"."assetsId" = "assets"."id"
where
"albums_assets_assets"."albumsId" = "albums"."id"
and "assets"."deletedAt" is null
and "assets"."isArchived" = $1
order by
"assets"."fileCreatedAt" desc
) as "asset"
) as "assets"
from
"albums"
where
"albums"."id" = $1
"albums"."id" = $2
and "albums"."deletedAt" is null
-- AlbumRepository.getByAssetId