From 8784c7192b4dacc09004902509afc9f34e420c66 Mon Sep 17 00:00:00 2001 From: Steven Bontenbal Date: Sat, 2 Nov 2024 13:59:18 +0100 Subject: [PATCH] Minor fixes --- frontend/src/components/CategoriesByType.vue | 14 ++++---------- frontend/src/stores/categoryStore.ts | 6 +++--- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/CategoriesByType.vue b/frontend/src/components/CategoriesByType.vue index 5f9f431..20baa8a 100644 --- a/frontend/src/components/CategoriesByType.vue +++ b/frontend/src/components/CategoriesByType.vue @@ -52,16 +52,10 @@ import { PropType, ref } from "vue"; import { Category, CategoryType } from "@/types"; -const props = defineProps({ - categories: { - type: Object as PropType>, - required: true - }, - categoryType: { - type: Object as PropType, - required: true - } -}) +const props = defineProps<{ + categories: Array, + categoryType: CategoryType +}>(); const emit = defineEmits(["remove", "save"]) // state diff --git a/frontend/src/stores/categoryStore.ts b/frontend/src/stores/categoryStore.ts index 7920388..ac903e1 100644 --- a/frontend/src/stores/categoryStore.ts +++ b/frontend/src/stores/categoryStore.ts @@ -56,11 +56,11 @@ export const useCategories = defineStore('categories', { }, async saveToServer(category: Category) { - await api.createNewCategory(category); + const response = await api.createNewCategory(category); if (category.type == CategoryType.Season) { - this.categories.season.push(category); + this.categories.season.push(response.data); } else { - this.categories.liturgical.push(category); + this.categories.liturgical.push(response.data); } },