better pending handling

This commit is contained in:
2025-07-26 09:15:29 -04:00
parent cf6fed50d3
commit ded6489edf

View File

@ -183,7 +183,7 @@ export async function pullData(amount = 100) {
let currentPend = let currentPend =
await db`SELECT id, amount, description, date from transaction where account_id = ${account.id} AND pending=true`; await db`SELECT id, amount, description, date from transaction where account_id = ${account.id} AND pending=true`;
for (const pend of currentPend) { for (const pend of currentPend) {
const found = transactions.find((t) => t.transactionId === pend.id); const found = transactions.find((t) => `${t.postedDate}:${t.amount}` === pend.id);
state.push( state.push(
`Pending transaction: ${pend.id} ${pend.description} ${pend.amount} on ${pend.date} found: ${found ? 'yes' : 'no'}` `Pending transaction: ${pend.id} ${pend.description} ${pend.amount} on ${pend.date} found: ${found ? 'yes' : 'no'}`
); );