feat: add socker connection between client and server

This commit is contained in:
Ahmed Bouhuolia
2024-02-24 00:18:48 +02:00
parent 1fd8a53ed1
commit 2d3544fe37
16 changed files with 357 additions and 27 deletions

View File

@@ -25,11 +25,15 @@ export class PlaidFetchTransactionsJob {
const plaidFetchTransactionsService = Container.get(
PlaidUpdateTransactions
);
const io = Container.get('socket');
try {
await plaidFetchTransactionsService.updateTransactions(
tenantId,
plaidItemId
);
// Notify the frontend to reflect the new transactions changes.
io.emit('NEW_TRANSACTIONS_DATA', { plaidItemId });
done();
} catch (error) {
console.log(error);