Skip to content

Commit

Permalink
test: decode response Payload before JSON.parse
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielforster committed Jan 23, 2024
1 parent a7bf835 commit 276dff6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scraper/ports/schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ export async function run () {
InvocationType: 'RequestResponse',
});

console.log("payload to string", Payload?.toString())
console.log("payload", Payload)
const string = new TextDecoder().decode(Payload);

const json = JSON.parse(Payload?.toString() || "{}") as { body: string };
const json = JSON.parse(string || "{}") as { body: string };

console.log("JSOn", json)

Expand Down

0 comments on commit 276dff6

Please sign in to comment.