mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-04 16:50:27 +00:00
test fixes
This commit is contained in:
parent
f1f455f8aa
commit
ad6115770d
2 changed files with 3 additions and 2 deletions
|
@ -356,7 +356,6 @@ func (e *ItemsRepository) QueryByGroup(ctx context.Context, gid uuid.UUID, q Ite
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// QueryByAssetID returns items by asset ID. If the item does not exist, an error is returned.
|
// QueryByAssetID returns items by asset ID. If the item does not exist, an error is returned.
|
||||||
func (e *ItemsRepository) QueryByAssetID(ctx context.Context, gid uuid.UUID, assetID AssetID, page int, pageSize int) (PaginationResult[ItemSummary], error) {
|
func (e *ItemsRepository) QueryByAssetID(ctx context.Context, gid uuid.UUID, assetID AssetID, page int, pageSize int) (PaginationResult[ItemSummary], error) {
|
||||||
qb := e.db.Item.Query().Where(
|
qb := e.db.Item.Query().Where(
|
||||||
|
@ -372,7 +371,7 @@ func (e *ItemsRepository) QueryByAssetID(ctx context.Context, gid uuid.UUID, ass
|
||||||
pageSize = -1
|
pageSize = -1
|
||||||
}
|
}
|
||||||
|
|
||||||
items, err := mapItemsSummaryErr(
|
items, err := mapItemsSummaryErr(
|
||||||
qb.Order(ent.Asc(item.FieldName)).
|
qb.Order(ent.Asc(item.FieldName)).
|
||||||
WithLabel().
|
WithLabel().
|
||||||
WithLocation().
|
WithLocation().
|
||||||
|
|
|
@ -36,6 +36,8 @@ func useItems(t *testing.T, len int) []ItemOut {
|
||||||
for _, item := range items {
|
for _, item := range items {
|
||||||
_ = tRepos.Items.Delete(context.Background(), item.ID)
|
_ = tRepos.Items.Delete(context.Background(), item.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_ = tRepos.Locations.Delete(context.Background(), location.ID)
|
||||||
})
|
})
|
||||||
|
|
||||||
return items
|
return items
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue