From d094143884c5e88e6229959b3e94cedc4f8d847c Mon Sep 17 00:00:00 2001 From: Hamoon Zamiri Date: Sat, 3 Aug 2024 22:04:57 -0400 Subject: [PATCH 1/2] build: makefile run command now executes docker compose up first --- backend/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/Makefile b/backend/Makefile index 453204e..9c104c5 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -1,7 +1,7 @@ build: @go build -o bin/goalify -run: build +run: build up @./bin/goalify unit: @echo "Running unit tests..." From ce53877f706915e391034d7e9f9b993b90b4b647 Mon Sep 17 00:00:00 2001 From: Hamoon Zamiri Date: Sat, 3 Aug 2024 22:05:11 -0400 Subject: [PATCH 2/2] feat: add ability to delete goal categories --- .../src/components/goals/GoalCategoryCard.vue | 91 ++++++++++++++++++- frontend/src/state/goals.ts | 8 ++ frontend/src/utils/api.ts | 14 +++ 3 files changed, 108 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/goals/GoalCategoryCard.vue b/frontend/src/components/goals/GoalCategoryCard.vue index e559754..7f1db5a 100644 --- a/frontend/src/components/goals/GoalCategoryCard.vue +++ b/frontend/src/components/goals/GoalCategoryCard.vue @@ -4,9 +4,20 @@ import GoalCard from "./GoalCard.vue"; import ModalForm from "../ModalForm.vue"; import CreateGoalForm from "./CreateGoalForm.vue"; import CreateGoalButton from "./CreateGoalButton.vue"; +import { Menu, MenuButton, MenuItems, MenuItem } from "@headlessui/vue"; +import { ApiClient } from "@/utils/api"; +import goalState from "@/state/goals"; const props = defineProps<{ goalCategory: GoalCategory; }>(); + +async function handleDeleteCategory(e: MouseEvent) { + e.preventDefault(); + await ApiClient.deleteCategory(props.goalCategory.id); + + // remove category from state + goalState.deleteCategory(props.goalCategory.id); +}