forked from mirrors/homebox
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 Former-commit-id: 321a83b6344461233979e4f45e60f3121b1ffcef
This commit is contained in:
parent
bd1a241be1
commit
81e76d9dd4
13 changed files with 41 additions and 424 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue