Extract action for API calls

This commit is contained in:
2022-01-26 21:55:36 +00:00
parent 0e438e0244
commit 0b1f673c05
2 changed files with 21 additions and 8 deletions

View File

@ -39,14 +39,7 @@ export default {
let formData = new FormData();
formData.append("transactions", this.$data.transactionsFile);
formData.append("assignments", this.$data.assignmentsFile);
fetch('/api/v1/budget/'+this.$store.getters.CurrentBudget.ID+"/import/ynab", {
method: "POST",
headers: {
'Authorization': 'Bearer ' + this.$store.state.Session.Token
},
body: formData}
);
this.$store.dispatch("YNAB", formData);
}
}
}