Skip to content

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

fix: item card not showing parent

tonyaellie71b951e3dedc
diff --git a/frontend/components/Item/Card.vue b/frontend/components/Item/Card.vue
index e2fe5e22..b011e8e5 100644
--- a/frontend/components/Item/Card.vue
+++ b/frontend/components/Item/Card.vue
@@ -27,7 +27,7 @@
/>
<div class="absolute inset-x-1 bottom-1">
<Badge class="text-wrap bg-secondary text-secondary-foreground hover:bg-secondary/70 hover:underline">
- <NuxtLink v-if="item.location" :to="`/location/${item.location.id}`">
+ <NuxtLink v-if="item.parent" :to="`/location/${item.parent.id}`">
{{ locationString }}
</NuxtLink>
</Badge>
@@ -127,7 +127,7 @@
const objectContain = computed(() => imageUrl.value !== "/no-image.jpg" && !preferences.value.legacyImageFit);
const locationString = computed(
- () => props.locationFlatTree.find(l => l.id === props.item.location?.id)?.treeString || props.item.location?.name
+ () => props.locationFlatTree.find(l => l.id === props.item.parent?.id)?.treeString || props.item.parent?.name
);
</script>