Skip to content

Commit

Permalink
Change latest to 3 days or 100 items
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Oct 12, 2024
1 parent 5d21ad4 commit 5da7a04
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apps/engine/src/providers/gocardless/gocardless-api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ProviderError } from "@/utils/error";
import { formatISO, subMonths } from "date-fns";
import { formatISO, subDays } from "date-fns";
import xior from "xior";
import type { XiorInstance, XiorRequestConfig } from "xior";
import type { GetInstitutionsRequest, ProviderParams } from "../types";
Expand Down Expand Up @@ -298,7 +298,7 @@ export class GoCardLessApi {
token,
latest
? {
date_from: formatISO(subMonths(new Date(), 1), {
date_from: formatISO(subDays(new Date(), 3), {
representation: "date",
}),
}
Expand Down
2 changes: 1 addition & 1 deletion apps/engine/src/providers/plaid/plaid-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class PlaidApi {
if (latest) {
const { data } = await this.#client.transactionsSync({
access_token: accessToken,
count: 500,
count: 100,
});

added = added.concat(data.added);
Expand Down
2 changes: 1 addition & 1 deletion apps/engine/src/providers/teller/teller-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class TellerApi {
`/accounts/${accountId}/transactions`,
accessToken,
{
count: latest ? 500 : count,
count: latest ? 100 : count,
},
);

Expand Down
1 change: 0 additions & 1 deletion packages/jobs/src/transactions/manual-sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ client.defineJob({
accountId: account.account_id,
accountType: getClassification(account.type),
accessToken: account.bank_connection?.access_token,
latest: true,
});

const formattedTransactions = transactions.data?.map((transaction) => {
Expand Down

0 comments on commit 5da7a04

Please sign in to comment.