Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-fidd committed Nov 11, 2024
1 parent be7ec28 commit 00f10fa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
10 changes: 5 additions & 5 deletions packages/loot-core/src/server/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,19 +270,19 @@ handlers['api/bank-sync'] = async function (args) {
ids: simpleFinAccountIds,
});

res.forEach(a => allErrors.push(a.errors));
res.forEach(a => allErrors.push(...a.res.errors));
}

const { errors } = await handlers['accounts-bank-sync']({
ids: accountIdsToSync.filter(a => !simpleFinAccountIds.includes(a)),
});

allErrors.push(errors);
allErrors.push(...errors);
}

const [firstError] = allErrors.filter(e => e != null);
if (firstError) {
throw new Error(getBankSyncError(firstError));
const errors = allErrors.filter(e => e != null);
if (errors.length > 0) {
throw new Error(getBankSyncError(errors[0]));
}
};

Expand Down
10 changes: 6 additions & 4 deletions packages/loot-core/src/types/server-handlers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,12 @@ export interface ServerHandlers {
'simplefin-batch-sync': ({ ids }: { ids: string[] }) => Promise<
{
accountId: string;
errors;
newTransactions;
matchedTransactions;
updatedAccounts;
res: {
errors;
newTransactions;
matchedTransactions;
updatedAccounts;
};
}[]
>;

Expand Down

0 comments on commit 00f10fa

Please sign in to comment.