Skip to content

Commit e8401bc

Browse files
committed
fixes for sharing, tests are working YAY!
1 parent bd12689 commit e8401bc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

api/internal/handlers/albums.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const (
4343
` ON a.cover_mediaitem_id=m.id WHERE a.user_id=$1 AND a.id=$2`
4444
queryGetAlbums = `SELECT a.*, m.id, m.user_id, m.source_url, m.preview_url, m.thumbnail_url, m.placeholder,` +
4545
` m.mediaitem_type, m.mediaitem_category, m.width, m.height FROM albums a LEFT JOIN mediaitems m` +
46-
` ON a.cover_mediaitem_id=m.id WHERE a.user_id=$1 AND a.is_hidden=false AND is_shared=$2 ORDER BY a.%s` +
46+
` ON a.cover_mediaitem_id=m.id WHERE a.user_id=$1 AND a.is_hidden=false AND a.is_shared=$2 ORDER BY a.%s` +
4747
` OFFSET $3 LIMIT $4`
4848
queryUpdateAlbum = `UPDATE albums SET name=$3, description=$4, is_shared=$5, is_hidden=$6,` +
4949
` cover_mediaitem_id=$7, updated_at=$8 WHERE user_id=$1 AND id=$2`

api/internal/handlers/sharing.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import (
1313

1414
const (
1515
queryGetSharedAlbumMediaItems = `SELECT * FROM mediaitems WHERE id IN (SELECT mediaitem_id FROM album_mediaitems` +
16-
` WHERE shared = true AND album_id=$1) AND is_hidden = false AND is_deleted = false ORDER BY created_at DESC OFFSET $2 LIMIT $3`
16+
` WHERE album_id=$1) AND is_hidden=false AND is_deleted=false ORDER BY created_at DESC OFFSET $2 LIMIT $3`
1717
queryGetSharedAlbum = `SELECT a.*, m.id, m.user_id, m.source_url, m.preview_url, m.thumbnail_url, m.placeholder,` +
1818
` m.mediaitem_type, m.mediaitem_category, m.width, m.height FROM albums a LEFT JOIN mediaitems m` +
19-
` ON a.cover_mediaitem_id=m.id WHERE a.shared = true AND a.id=$1`
19+
` ON a.cover_mediaitem_id=m.id WHERE a.is_shared=true AND a.id=$1`
2020
)
2121

2222
// GetSharedAlbumMediaItems ...

0 commit comments

Comments
 (0)