Skip to content

Commit

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

export const handler = async (records) => {
console.log('Records: ', records);
for (record of records) {
export const handler = async (data) => {
console.log('Data: ', data);
for (const record of data.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 20c4eee

Please sign in to comment.