diff --git a/src/components/SavingsPath.vue b/src/components/SavingsPath.vue index b71a11bb1b657160eea30453ff91600acded5f0f..e2d963e7d8cdac633f328c19b09727a679b1ebc3 100644 --- a/src/components/SavingsPath.vue +++ b/src/components/SavingsPath.vue @@ -166,6 +166,7 @@ <div ref="targetRef" class="bg-yellow-400 px-4 py-1 rounded-full text-black font-bold" + v-if="goal.saved >= goal.target" > {{ goal.saved }}kr / {{ goal.target }}kr </div> @@ -210,7 +211,6 @@ watch( (newGoal, oldGoal) => { if (newGoal !== oldGoal) { goal.value = newGoal - console.log('Updated goal:', goal.value) } }, { immediate: true } @@ -221,7 +221,6 @@ watch( (newChallenges, oldChallenges) => { if (newChallenges !== oldChallenges) { challenges.value = newChallenges - console.log('Updated challenges:', challenges.value) } }, { immediate: true } @@ -254,8 +253,6 @@ const incrementSaved = async (challenge: Challenge) => { challenge.completion = 100 } - console.log('Incrementing saved amount for:', challenge) - // Safely update the goal's saved value, ensuring goal.value exists and is not null if (goal.value) { goal.value.saved = (goal.value.saved || 0) + challenge.perPurchase @@ -282,11 +279,11 @@ const recalculateAndAnimate = () => { } const editChallenge = (challenge: Challenge) => { - router.push(`/spareutfordringer/${challenge.id}`) + router.push(`/spareutfordringer/rediger/${challenge.id}`) } const editGoal = (goal: Goal) => { - router.push(`/sparemaal/${goal.id}`) + router.push(`/sparemaal/rediger/${goal.id}`) } // Declare the ref with a type annotation for an array of strings @@ -439,9 +436,8 @@ const getPigStepsIcon = () => { return 'src/assets/pigSteps.png' } -// TODO - Change when EditGoal view is created const goToEditGoal = () => { - router.push({ name: 'EditGoal' }) + router.push({ name: 'edit-goal', params: { id: goal.value?.id } }) } </script>