fix error when item doesn't have photo attachment

This commit is contained in:
Hayden 2023-12-01 11:36:29 -06:00
parent d1d98bcb06
commit 3f455cb574
No known key found for this signature in database
GPG key ID: 17CF79474E257545

View file

@ -845,6 +845,7 @@ func (e *ItemsRepository) SetPrimaryPhotos(ctx context.Context, GID uuid.UUID) (
Where( Where(
item.HasGroupWith(group.ID(GID)), item.HasGroupWith(group.ID(GID)),
item.HasAttachmentsWith( item.HasAttachmentsWith(
attachment.TypeEQ(attachment.TypePhoto),
attachment.Not( attachment.Not(
attachment.And( attachment.And(
attachment.Primary(true), attachment.Primary(true),