Navigate to budgeting from closed account
This commit is contained in:
parent
a0cabbf4f7
commit
15381c84f6
@ -4,7 +4,10 @@ import Modal from '../components/Modal.vue';
|
|||||||
import { useAccountStore } from '../stores/budget-account';
|
import { useAccountStore } from '../stores/budget-account';
|
||||||
import Input from '../components/Input.vue';
|
import Input from '../components/Input.vue';
|
||||||
import Checkbox from '../components/Checkbox.vue';
|
import Checkbox from '../components/Checkbox.vue';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import { useBudgetsStore } from '../stores/budget';
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
const accountStore = useAccountStore();
|
const accountStore = useAccountStore();
|
||||||
const CurrentAccount = computed(() => accountStore.CurrentAccount);
|
const CurrentAccount = computed(() => accountStore.CurrentAccount);
|
||||||
|
|
||||||
@ -14,6 +17,12 @@ const accountOpen = ref(true);
|
|||||||
|
|
||||||
function editAccount(e : any) {
|
function editAccount(e : any) {
|
||||||
accountStore.EditAccount(CurrentAccount.value?.ID ?? "", accountName.value, accountOnBudget.value, accountOpen.value);
|
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) {
|
function openEditAccount(e : any) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user