From 5d51c74af2c80c2f0c3df8cb68b70094e76d317d Mon Sep 17 00:00:00 2001 From: Matt Kilgore Date: Fri, 29 Nov 2024 10:21:12 -0500 Subject: [PATCH] fix: PR #347 broke ItemCard component, this fixes it. Sets the locationFlatTree to be an optional prop for the Card component. With a default of an empty array. --- .gitignore | 3 ++- Taskfile.yml | 2 ++ frontend/components/Item/Card.vue | 9 +++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 51a835a44..a1ed69af7 100644 --- a/.gitignore +++ b/.gitignore @@ -56,4 +56,5 @@ backend/app/api/static/public/* !backend/app/api/static/public/.gitkeep backend/api -docs/.vitepress/cache/ \ No newline at end of file +docs/.vitepress/cache/ +/.data/ diff --git a/Taskfile.yml b/Taskfile.yml index 4d9c1aa28..dc3f73c4a 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -52,6 +52,8 @@ tasks: - cp ./backend/app/api/static/docs/swagger.json docs/docs/api/openapi-2.0.json go:run: + env: + HBOX_DEMO: true desc: Starts the backend api server (depends on generate task) dir: backend deps: diff --git a/frontend/components/Item/Card.vue b/frontend/components/Item/Card.vue index 792222973..4b8997a7b 100644 --- a/frontend/components/Item/Card.vue +++ b/frontend/components/Item/Card.vue @@ -69,13 +69,14 @@ }, locationFlatTree: { type: Array as () => FlatTreeItem[], - required: true, + required: false, + default: () => [], }, }); - const locationString = computed(() => { - return props.locationFlatTree.find(l => l.id === props.item.location.id)?.treeString || props.item.location.name; - }); + const locationString = computed( + () => props.locationFlatTree.find(l => l.id === props.item.location?.id)?.treeString || props.item.location?.name + );