Skip to content

A continuation of HomeBox the inventory and organization system built for the Home User

fix: items edit page showing location as parent item and parent location

Matthew Kilgore0e0c171608aa
diff --git a/backend/internal/data/repo/repo_entities.go b/backend/internal/data/repo/repo_entities.go
index 4e185172..b9f88973 100644
--- a/backend/internal/data/repo/repo_entities.go
+++ b/backend/internal/data/repo/repo_entities.go
@@ -430,7 +430,9 @@ func (r *EntityRepository) getOneTx(ctx context.Context, tx *ent.Tx, where ...pr
out, err := mapEntityOutErr(q.
WithFields().
WithTag().
- WithParent().
+ WithParent(func(eq *ent.EntityQuery) {
+ eq.WithEntityType()
+ }).
WithEntityType().
WithGroup().
WithChildren(func(eq *ent.EntityQuery) {
diff --git a/frontend/pages/item/[id]/index/edit.vue b/frontend/pages/item/[id]/index/edit.vue
index 5308ef0a..123fa0aa 100644
--- a/frontend/pages/item/[id]/index/edit.vue
+++ b/frontend/pages/item/[id]/index/edit.vue
@@ -64,7 +64,7 @@
return;
}
- if (data.parent) {
+ if (data.parent && data.parent.entityType && !data.parent.entityType.isLocation) {
parent.value = data.parent;
}