Closed psybers closed 3 weeks ago
The changes in the pull request primarily focus on the src/app-simplefin/app-simplefin.js
file, specifically modifying the handling of API requests for accounts and transactions. The function signatures for both getAccounts
and getTransactions
have been updated to include an additional parameter, accounts
, which allows for filtering based on specific account IDs.
In the /accounts
endpoint, the updated getAccounts
function now includes the accounts
parameter while maintaining the existing logic for the accessKey
. For the /transactions
endpoint, the getTransactions
function has been modified to ensure that the accountId
and startDate
parameters are of the same type and checks their lengths if they are arrays.
Error handling has been improved across both endpoints, with specific error messages logged for mismatched array lengths in the /transactions
endpoint and centralized handling for invalid tokens. Additionally, utility functions have been adjusted to incorporate the new accounts
parameter, enhancing the construction of query strings for API requests.
getAccounts
function in the same file, enhancing error handling and introducing a new parameter that affects how accounts are retrieved, which is directly related to the changes made in the main PR regarding the handling of account requests.sparkles: Merged
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
I have tested this PR and it works (with my data at least).
Sorry if I merged these in the wrong order, looks like there's a conflict now
@matt-fidd No I knew they would conflict, either way you merged them. Conflict is resolved now.
This utilizes the new support for
account=
in the SimpleFIN API so that when requesting transactions you can specify which account(s). When Actual syncs a single account, this uses that parameter to limit the data sent back.See: https://github.com/simplefin/simplefin.github.com/pull/26 for details on the new API being used.