From a8dd2274d1a23cb0ac4eb6222030160e9cee177f Mon Sep 17 00:00:00 2001 From: Matthew Huntington Date: Wed, 28 Aug 2024 21:02:43 +0200 Subject: [PATCH] category chooser might actually be done --- src/App.vue | 6 +++--- src/components/show_category.vue | 4 +++- src/components/summary.vue | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/App.vue b/src/App.vue index fa2b956..bc09694 100644 --- a/src/App.vue +++ b/src/App.vue @@ -14,8 +14,8 @@ const instruments = ref([]) const categories = ref([]) - const updateCurrentWorkingCategoryID = (category) =>{ - currentWorkingCategory.value = category + const updateCurrentWorkingCategory = (summarizedCategory) =>{ + currentWorkingCategory.value = categories.value.find(category => category.id === summarizedCategory.category_id) } const refreshPage = (session) => { @@ -47,7 +47,7 @@ -->
- +
props.currentWorkingCategory, (chosenCategory)=>{ + loadCategory(chosenCategory.id) + }) defineExpose({loadCategory}) diff --git a/src/components/summary.vue b/src/components/summary.vue index 84f3268..7dfb26b 100644 --- a/src/components/summary.vue +++ b/src/components/summary.vue @@ -12,7 +12,7 @@ onMounted(loadData) const setWorkingCategory = (category) => { - emit('update', category.category_id) + emit('update', category) } defineExpose({loadData})