From fb9e3d6735046415436598983c939487a28afa31 Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Sun, 23 Oct 2022 20:38:02 -0800 Subject: [PATCH] add location selector --- frontend/components/Form/Autocomplete.vue | 2 +- frontend/components/Location/Card.vue | 20 +++++++++---- frontend/lib/api/classes/locations.ts | 4 +-- frontend/lib/api/types/data-contracts.ts | 9 ++++++ frontend/pages/location/[id].vue | 36 +++++++++++++++++++++-- 5 files changed, 59 insertions(+), 12 deletions(-) diff --git a/frontend/components/Form/Autocomplete.vue b/frontend/components/Form/Autocomplete.vue index 28dd6f3..dffb33d 100644 --- a/frontend/components/Form/Autocomplete.vue +++ b/frontend/components/Form/Autocomplete.vue @@ -50,7 +50,7 @@ interface Props { label: string; modelValue: string | ItemsObject; - items: string[] | ItemsObject[]; + items: ItemsObject[] | Record[] | string[]; itemText?: keyof ItemsObject; itemValue?: keyof ItemsObject; search?: string; diff --git a/frontend/components/Location/Card.vue b/frontend/components/Location/Card.vue index 56b36a2..bb5f1f7 100644 --- a/frontend/components/Location/Card.vue +++ b/frontend/components/Location/Card.vue @@ -17,20 +17,18 @@ {{ location.name }} - - {{ location.itemCount }} + {{ count }} @@ -152,11 +177,18 @@ -
+
Items
+ +
+ Child Locations +
+ +
+