diff --git a/frontend/components/Form/Autocomplete.vue b/frontend/components/Form/Autocomplete.vue index 1352067..b2e2d44 100644 --- a/frontend/components/Form/Autocomplete.vue +++ b/frontend/components/Form/Autocomplete.vue @@ -51,7 +51,7 @@ interface Props { label: string; - modelValue: string | ItemsObject; + modelValue: string | ItemsObject | null | undefined; items: ItemsObject[] | string[]; itemText?: keyof ItemsObject; itemSearch?: keyof ItemsObject | null; @@ -129,7 +129,7 @@ } ); - function select(obj: string | ItemsObject) { + function select(obj: Props["modelValue"]) { if (isStrings(props.items)) { if (obj === value.value) { value.value = ""; diff --git a/frontend/components/Location/CreateModal.vue b/frontend/components/Location/CreateModal.vue index 32381ac..579b962 100644 --- a/frontend/components/Location/CreateModal.vue +++ b/frontend/components/Location/CreateModal.vue @@ -10,24 +10,7 @@ label="Location Name" /> - - - + @@ -44,14 +27,11 @@ }, }); - const locations = await useFlatLocations(); - const modal = useVModel(props, "modelValue"); const loading = ref(false); const focused = ref(false); const form = reactive({ name: "", - search: "", description: "", parent: null as LocationSummary | null, }); @@ -66,7 +46,6 @@ function reset() { form.name = ""; form.description = ""; - form.search = ""; form.parent = null; focused.value = false; modal.value = false; diff --git a/frontend/components/Location/Selector.vue b/frontend/components/Location/Selector.vue new file mode 100644 index 0000000..e519af3 --- /dev/null +++ b/frontend/components/Location/Selector.vue @@ -0,0 +1,49 @@ + + + diff --git a/frontend/pages/item/[id]/index/edit.vue b/frontend/pages/item/[id]/index/edit.vue index e73cce0..0cb1267 100644 --- a/frontend/pages/item/[id]/index/edit.vue +++ b/frontend/pages/item/[id]/index/edit.vue @@ -358,13 +358,7 @@
- + - +