From 3f455cb57491163f7bcf13a7452cd4cf7514ffa3 Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Fri, 1 Dec 2023 11:36:29 -0600 Subject: [PATCH] fix error when item doesn't have photo attachment --- backend/internal/data/repo/repo_items.go | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/internal/data/repo/repo_items.go b/backend/internal/data/repo/repo_items.go index 6ae274b..6358a98 100644 --- a/backend/internal/data/repo/repo_items.go +++ b/backend/internal/data/repo/repo_items.go @@ -845,6 +845,7 @@ func (e *ItemsRepository) SetPrimaryPhotos(ctx context.Context, GID uuid.UUID) ( Where( item.HasGroupWith(group.ID(GID)), item.HasAttachmentsWith( + attachment.TypeEQ(attachment.TypePhoto), attachment.Not( attachment.And( attachment.Primary(true),