refactor(ynab): specify a budget when creating a connection
This commit is contained in:
@@ -10,7 +10,7 @@ export default defineTrigger({
|
||||
async run($) {
|
||||
const categoryWithNegativeBalance = [];
|
||||
|
||||
const response = await $.http.get('/budgets/last-used/categories');
|
||||
const response = await $.http.get('/budgets/default/categories');
|
||||
const categoryGroups = response.data.data.category_groups;
|
||||
|
||||
categoryGroups.forEach((group) => {
|
||||
|
@@ -9,7 +9,7 @@ export default defineTrigger({
|
||||
async run($) {
|
||||
const goalCompletedCategories = [];
|
||||
|
||||
const response = await $.http.get('/budgets/last-used/categories');
|
||||
const response = await $.http.get('/budgets/default/categories');
|
||||
const categoryGroups = response.data.data.category_groups;
|
||||
|
||||
categoryGroups.forEach((group) => {
|
||||
|
@@ -21,7 +21,7 @@ export default defineTrigger({
|
||||
const balanceBelowAmount = $.step.parameters.balanceBelowAmount;
|
||||
const formattedBalance = balanceBelowAmount * 1000;
|
||||
|
||||
const response = await $.http.get('/budgets/last-used/accounts');
|
||||
const response = await $.http.get('/budgets/default/accounts');
|
||||
|
||||
if (response.data?.data?.accounts?.length) {
|
||||
for (const account of response.data.data.accounts) {
|
||||
|
@@ -7,7 +7,7 @@ export default defineTrigger({
|
||||
description: 'Triggers when a new transaction is created.',
|
||||
|
||||
async run($) {
|
||||
const response = await $.http.get('/budgets/last-used/transactions');
|
||||
const response = await $.http.get('/budgets/default/transactions');
|
||||
const transactions = response.data.data?.transactions;
|
||||
|
||||
if (transactions?.length) {
|
||||
|
Reference in New Issue
Block a user