Skip to content

Instantly share code, notes, and snippets.

@joelanman
Created January 20, 2022 16:10
Show Gist options
  • Save joelanman/1616e65261f96c5875b1dbc8d283665c to your computer and use it in GitHub Desktop.
Save joelanman/1616e65261f96c5875b1dbc8d283665c to your computer and use it in GitHub Desktop.
router.get("/letters-contact-preference-audio", function(request, response){
let preferences = request.session.data['lettersContactPreference']
if (preferences.length && preferences.includes('audio'){
response.render("letters-contact-preference-audio")
} else {
response.redirect("/letters-contact-preference-braille")
}
})
router.get("/letters-contact-preference-braille", function(request, response){
let preferences = request.session.data['lettersContactPreference']
if (preferences.length && preferences.includes('braille'){
response.render("letters-contact-preference-braille")
} else {
response.redirect("/letters-contact-preference-coloured-paper")
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment