Skip to content

Commit

Permalink
fix: PR #347 broke ItemCard component, this fixes it.
Browse files Browse the repository at this point in the history
Sets the locationFlatTree to be an optional prop for the Card component. With a default of an empty array.
  • Loading branch information
tankerkiller125 committed Nov 29, 2024
1 parent 121d577 commit 5d51c74
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ backend/app/api/static/public/*
!backend/app/api/static/public/.gitkeep
backend/api

docs/.vitepress/cache/
docs/.vitepress/cache/
/.data/
2 changes: 2 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 5 additions & 4 deletions frontend/components/Item/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
</script>

<style lang="css"></style>

0 comments on commit 5d51c74

Please sign in to comment.