diff --git a/backend/internal/data/repo/repo_items.go b/backend/internal/data/repo/repo_items.go index f5ddb4e..d6faccd 100644 --- a/backend/internal/data/repo/repo_items.go +++ b/backend/internal/data/repo/repo_items.go @@ -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. 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( @@ -372,7 +371,7 @@ func (e *ItemsRepository) QueryByAssetID(ctx context.Context, gid uuid.UUID, ass pageSize = -1 } - items, err := mapItemsSummaryErr( + items, err := mapItemsSummaryErr( qb.Order(ent.Asc(item.FieldName)). WithLabel(). WithLocation(). diff --git a/backend/internal/data/repo/repo_items_test.go b/backend/internal/data/repo/repo_items_test.go index 4b958b0..6d361ba 100644 --- a/backend/internal/data/repo/repo_items_test.go +++ b/backend/internal/data/repo/repo_items_test.go @@ -36,6 +36,8 @@ func useItems(t *testing.T, len int) []ItemOut { for _, item := range items { _ = tRepos.Items.Delete(context.Background(), item.ID) } + + _ = tRepos.Locations.Delete(context.Background(), location.ID) }) return items