Navigate to budgeting from closed account
This commit is contained in:
		| @@ -4,7 +4,10 @@ import Modal from '../components/Modal.vue'; | ||||
| import { useAccountStore } from '../stores/budget-account'; | ||||
| import Input from '../components/Input.vue'; | ||||
| import Checkbox from '../components/Checkbox.vue'; | ||||
| import { useRouter } from 'vue-router'; | ||||
| import { useBudgetsStore } from '../stores/budget'; | ||||
|  | ||||
| const router = useRouter(); | ||||
| const accountStore = useAccountStore(); | ||||
| const CurrentAccount = computed(() => accountStore.CurrentAccount); | ||||
|  | ||||
| @@ -14,6 +17,12 @@ const accountOpen = ref(true); | ||||
|  | ||||
| function editAccount(e : any) { | ||||
|     accountStore.EditAccount(CurrentAccount.value?.ID ?? "", accountName.value, accountOnBudget.value, accountOpen.value); | ||||
|  | ||||
|     // account closed, move to Budget | ||||
|     if(!accountOpen.value){ | ||||
|         const currentBudgetID = useBudgetsStore().CurrentBudgetID; | ||||
|         router.replace('/budget/'+currentBudgetID+'/budgeting'); | ||||
|     } | ||||
| } | ||||
|  | ||||
| function openEditAccount(e : any) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user