Skip to content

Commit

Permalink
feat(cb2-10603): debug
Browse files Browse the repository at this point in the history
  • Loading branch information
naathanbrown committed Apr 2, 2024
1 parent 083bbfe commit 7e1e419
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/utils/sqsProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,13 @@ import DynamoDB from "aws-sdk/clients/dynamodb";

export const processRecord = (record: any) => {
const recordBody = JSON.parse(JSON.parse(record.body).Message);

console.log("record body is, ", recordBody);
console.log("record eventName is, ", recordBody.eventName);
console.log("record dynamodb is, ", recordBody.dynamodb);
console.log("record new image is, ", recordBody.dynamodb.NewImage);
console.log(recordBody.eventName === "MODIFY");
console.log(!!recordBody.dynamodb);
console.log(!!recordBody.dynamodb.NewImage);
console.log(
recordBody.eventName === "MODIFY"
&& recordBody.dynamodb
&& recordBody.dynamodb.NewImage
);
if (
recordBody.eventName === "MODIFY"
&& recordBody.dynamodb
&& recordBody.dynamodb.NewImage
) {
return DynamoDB.Converter.unmarshall(recordBody.dynamodb.NewImage);
}
console.error(`process return undefined, record is ${recordBody}`);
console.error(`process return undefined, record is ${JSON.stringify(recordBody)}`);
return undefined;
};

0 comments on commit 7e1e419

Please sign in to comment.