mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-21 21:33:02 +01:00
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.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -57,3 +57,4 @@ backend/app/api/static/public/*
|
|||||||
backend/api
|
backend/api
|
||||||
|
|
||||||
docs/.vitepress/cache/
|
docs/.vitepress/cache/
|
||||||
|
/.data/
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ tasks:
|
|||||||
- cp ./backend/app/api/static/docs/swagger.json docs/docs/api/openapi-2.0.json
|
- cp ./backend/app/api/static/docs/swagger.json docs/docs/api/openapi-2.0.json
|
||||||
|
|
||||||
go:run:
|
go:run:
|
||||||
|
env:
|
||||||
|
HBOX_DEMO: true
|
||||||
desc: Starts the backend api server (depends on generate task)
|
desc: Starts the backend api server (depends on generate task)
|
||||||
dir: backend
|
dir: backend
|
||||||
deps:
|
deps:
|
||||||
|
|||||||
@@ -69,13 +69,14 @@
|
|||||||
},
|
},
|
||||||
locationFlatTree: {
|
locationFlatTree: {
|
||||||
type: Array as () => FlatTreeItem[],
|
type: Array as () => FlatTreeItem[],
|
||||||
required: true,
|
required: false,
|
||||||
|
default: () => [],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const locationString = computed(() => {
|
const locationString = computed(
|
||||||
return props.locationFlatTree.find(l => l.id === props.item.location.id)?.treeString || props.item.location.name;
|
() => props.locationFlatTree.find(l => l.id === props.item.location?.id)?.treeString || props.item.location?.name
|
||||||
});
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="css"></style>
|
<style lang="css"></style>
|
||||||
|
|||||||
Reference in New Issue
Block a user