Merge pull request #1866 from automatisch/fix-ynab

refactor(ynab): specify a budget when creating a connection
This commit is contained in:
Ali BARIN
2024-05-08 12:00:46 +02:00
committed by GitHub
5 changed files with 10 additions and 9 deletions

View File

@@ -10,7 +10,7 @@ export default defineTrigger({
async run($) { async run($) {
const categoryWithNegativeBalance = []; 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; const categoryGroups = response.data.data.category_groups;
categoryGroups.forEach((group) => { categoryGroups.forEach((group) => {

View File

@@ -9,7 +9,7 @@ export default defineTrigger({
async run($) { async run($) {
const goalCompletedCategories = []; 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; const categoryGroups = response.data.data.category_groups;
categoryGroups.forEach((group) => { categoryGroups.forEach((group) => {

View File

@@ -21,7 +21,7 @@ export default defineTrigger({
const balanceBelowAmount = $.step.parameters.balanceBelowAmount; const balanceBelowAmount = $.step.parameters.balanceBelowAmount;
const formattedBalance = balanceBelowAmount * 1000; 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) { if (response.data?.data?.accounts?.length) {
for (const account of response.data.data.accounts) { for (const account of response.data.data.accounts) {

View File

@@ -7,7 +7,7 @@ export default defineTrigger({
description: 'Triggers when a new transaction is created.', description: 'Triggers when a new transaction is created.',
async run($) { 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; const transactions = response.data.data?.transactions;
if (transactions?.length) { if (transactions?.length) {

View File

@@ -11,8 +11,9 @@ connection in Automatisch. If any of the steps are outdated, please let us know!
4. Click on the **New Application** under the **OAuth Applications** section. 4. Click on the **New Application** under the **OAuth Applications** section.
5. Fill the new application form. 5. Fill the new application form.
6. Copy **OAuth Redirect URL** from Automatisch and paste it in **Redirect URI(s)** section. 6. Copy **OAuth Redirect URL** from Automatisch and paste it in **Redirect URI(s)** section.
7. Click on the **Save Application** button. 7. Enable the option **Enable default budget selection when users authorize this application**.
8. Copy the **Client ID** value to the **Client ID** field on Automatisch. 8. Click on the **Save Application** button.
9. Copy the **Client Secret** value to the **Client Secret** field on Automatisch. 9. Copy the **Client ID** value to the **Client ID** field on Automatisch.
10. Fill the **Screen Name** field on Automatisch. 10. Copy the **Client Secret** value to the **Client Secret** field on Automatisch.
11. Congrats! Start using your new You Need A Budget connection within the flows. 11. Fill the **Screen Name** field on Automatisch.
12. Congrats! Start using your new You Need A Budget connection within the flows.