Skip to content

Commit

Permalink
Fixes message reading
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanwrightAND committed Apr 24, 2024
1 parent 55675a8 commit e1a7d8b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ const updateElasticIndex = async (contentfulEntry, action) => {
}
};

export const handler = async (messages) => {
for (record of messages.Records) {
export const handler = async (records) => {
console.log('Records: ', records);
for (record of records) {
console.log('Message Recieved: ', message);
if (!record.body || !record.body.contentfulEntryId || !record.body.type)
throw new Error(`Invalid Message: ${record.body}`);
Expand Down

0 comments on commit e1a7d8b

Please sign in to comment.