From 3b5ab0b24461a0c4d2115dd46abdc195fb8f5447 Mon Sep 17 00:00:00 2001 From: Joao Pedro da Silva Date: Tue, 28 Nov 2023 13:32:48 -0300 Subject: [PATCH] replace native fetch by node-fetch --- services/microcredit/handler.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/microcredit/handler.ts b/services/microcredit/handler.ts index 9cdcf66b..563e103d 100644 --- a/services/microcredit/handler.ts +++ b/services/microcredit/handler.ts @@ -1,9 +1,11 @@ +import 'cross-fetch/polyfill'; import { updateBorrowers, updateCurrentDebt } from './src/borrowers'; import { welcome, increasingInterest, unpaidLoan, lowPerformance, highPerformance, reachingMaturity } from './src/notification'; import { utils, config } from '@impactmarket/core'; global.btoa = (str: string) => Buffer.from(str, 'binary').toString('base64'); global.atob = (str: string) => Buffer.from(str, 'base64').toString('binary'); +global.fetch = require('node-fetch').default; export const borrowers = async (event, context) => { await updateBorrowers();