sort items

This commit is contained in:
Hayden 2022-10-15 13:23:51 -08:00
parent 47f9724411
commit 0210bd3014

View file

@ -24,6 +24,7 @@ type (
Search string `json:"search"`
LocationIDs []uuid.UUID `json:"locationIds"`
LabelIDs []uuid.UUID `json:"labelIds"`
SortBy string `json:"sortBy"`
}
ItemCreate struct {
@ -252,7 +253,8 @@ func (e *ItemsRepository) QueryByGroup(ctx context.Context, gid uuid.UUID, q Ite
}
items, err := mapItemsSummaryErr(
qb.WithLabel().
qb.Order(ent.Asc(item.FieldName)).
WithLabel().
WithLocation().
All(ctx),
)