fix/feat: primary photo auto set and auto-set primary photo (#651)

* fix error when item doesn't have photo attachment

* automatically detect image types and set primary photo if first

* remove charts.js from libs
This commit is contained in:
Hayden 2023-12-01 11:57:29 -06:00 committed by GitHub
parent d1d98bcb06
commit 321a83b634
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 41 additions and 424 deletions

View file

@ -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),