Skip to content

Commit

Permalink
Update getMessagesAtom to include copyright information in original p…
Browse files Browse the repository at this point in the history
…osition
  • Loading branch information
nikiwycherley committed Jun 10, 2024
1 parent 318d65c commit a6d41ec
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/functions/getMessagesAtom.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ module.exports.getMessagesAtom = async (event) => {
})
}

let atomFeed = feed.atom1()
const atomFeed = feed.atom1()

const copyrightText = 'Copyright (c) 2024, Environment Agency. Licensed under Creative Commons BY 4.0'
atomFeed = atomFeed.replace('</feed>', `<copyright>${copyrightText}</copyright></feed>`)

response.body = atomFeed
const position = atomFeed.indexOf('<entry>')
const feedWithCopyright = `${atomFeed.slice(0, position)}${copyrightText}${atomFeed.slice(position)}`

response.body = feedWithCopyright
return response
}

0 comments on commit a6d41ec

Please sign in to comment.