Merge pull request #1866 from automatisch/fix-ynab
refactor(ynab): specify a budget when creating a connection
This commit is contained in:
@@ -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) => {
|
||||||
|
@@ -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) => {
|
||||||
|
@@ -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) {
|
||||||
|
@@ -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) {
|
||||||
|
@@ -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.
|
||||||
|
Reference in New Issue
Block a user