mirror of
https://github.com/hay-kot/homebox.git
synced 2025-06-27 14:18:35 +00:00
fix: other minor fixes (#388)
* remove overflow-hidden on when no collapsed * fix recently added on homescreen * fix delete account formatting * add manufacturer to search * move nav button to left
This commit is contained in:
parent
ced5aef6d1
commit
4dd925caf0
8 changed files with 38 additions and 20 deletions
|
@ -29,13 +29,14 @@ type (
|
|||
ItemQuery struct {
|
||||
Page int
|
||||
PageSize int
|
||||
Search string `json:"search"`
|
||||
AssetID AssetID `json:"assetId"`
|
||||
LocationIDs []uuid.UUID `json:"locationIds"`
|
||||
LabelIDs []uuid.UUID `json:"labelIds"`
|
||||
SortBy string `json:"sortBy"`
|
||||
IncludeArchived bool `json:"includeArchived"`
|
||||
Fields []FieldQuery
|
||||
Search string `json:"search"`
|
||||
AssetID AssetID `json:"assetId"`
|
||||
LocationIDs []uuid.UUID `json:"locationIds"`
|
||||
LabelIDs []uuid.UUID `json:"labelIds"`
|
||||
SortBy string `json:"sortBy"`
|
||||
IncludeArchived bool `json:"includeArchived"`
|
||||
Fields []FieldQuery `json:"fields"`
|
||||
OrderBy string `json:"orderBy"`
|
||||
}
|
||||
|
||||
ItemField struct {
|
||||
|
@ -326,6 +327,7 @@ func (e *ItemsRepository) QueryByGroup(ctx context.Context, gid uuid.UUID, q Ite
|
|||
item.NameContainsFold(q.Search),
|
||||
item.DescriptionContainsFold(q.Search),
|
||||
item.NotesContainsFold(q.Search),
|
||||
item.ManufacturerContainsFold(q.Search),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
@ -385,7 +387,17 @@ func (e *ItemsRepository) QueryByGroup(ctx context.Context, gid uuid.UUID, q Ite
|
|||
return PaginationResult[ItemSummary]{}, err
|
||||
}
|
||||
|
||||
qb = qb.Order(ent.Asc(item.FieldName)).
|
||||
// Order
|
||||
switch q.OrderBy {
|
||||
case "createdAt":
|
||||
qb = qb.Order(ent.Desc(item.FieldCreatedAt))
|
||||
case "updatedAt":
|
||||
qb = qb.Order(ent.Desc(item.FieldUpdatedAt))
|
||||
default: // "name"
|
||||
qb = qb.Order(ent.Asc(item.FieldName))
|
||||
}
|
||||
|
||||
qb = qb.
|
||||
WithLabel().
|
||||
WithLocation()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue