Skip to content

Commit

Permalink
fix(server): failed to get albums with archived assets (#15611)
Browse files Browse the repository at this point in the history
* fix(mobile): failed to get albums with archived assets

* sql
  • Loading branch information
alextran1502 authored Jan 24, 2025
1 parent 3c1fa22 commit 9d8072b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions server/src/queries/album.repository.sql
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,14 @@ select
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" = $2
"albums"."id" = $1
and "albums"."deletedAt" is null

-- AlbumRepository.getByAssetId
Expand Down
1 change: 0 additions & 1 deletion server/src/repositories/album.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ const withAssets = (eb: ExpressionBuilder<DB, 'albums'>) => {
.innerJoin('albums_assets_assets', 'albums_assets_assets.assetsId', 'assets.id')
.whereRef('albums_assets_assets.albumsId', '=', 'albums.id')
.where('assets.deletedAt', 'is', null)
.where('assets.isArchived', '=', false)
.orderBy('assets.fileCreatedAt', 'desc')
.as('asset'),
)
Expand Down

0 comments on commit 9d8072b

Please sign in to comment.