Bugfix: res.end -> res.send

The former was working fine while testing, but on the website it
made the browser try to *download* the page instead of opening it
in a normal fashion. This change will (hopefully) stem the madness
;P
This commit is contained in:
Hippo 2022-01-06 19:18:05 +05:30
parent 6383a196c5
commit 3272c6528d

View file

@ -269,7 +269,7 @@ router.post('/pledge', async (req, res) => {
errors: errors, errors: errors,
}) })
res.end(output) res.send(output)
return return
} }
@ -283,7 +283,7 @@ router.post('/pledge', async (req, res) => {
error: "Sorry, something went wrong while saving your pledge and we don't know what in was. This website is still in beta so we do have a glitches once in a while. Apologies and please try again...🙁", error: "Sorry, something went wrong while saving your pledge and we don't know what in was. This website is still in beta so we do have a glitches once in a while. Apologies and please try again...🙁",
}) })
res.end(output) res.send(output)
return return
} }
@ -337,7 +337,7 @@ The Snipette Team`
twing.render('pledge.htm.twig', { twing.render('pledge.htm.twig', {
'email': pledge.get('email'), 'email': pledge.get('email'),
}).then((output) => { }).then((output) => {
res.end(output) res.send(output)
}) })
}) })
@ -358,7 +358,7 @@ router.get('/verify', async (req, res) => {
error: "Sorry, looks like your link has expired. Please go back and try pledging again. Hopefully you'll manage it quicker this time 😛", error: "Sorry, looks like your link has expired. Please go back and try pledging again. Hopefully you'll manage it quicker this time 😛",
}) })
res.end(output) res.send(output)
return return
} else { } else {
@ -366,7 +366,7 @@ router.get('/verify', async (req, res) => {
error: "An unknown error occurred. Please generate a new link and try again. Sorry for the inconvenience 🤦", error: "An unknown error occurred. Please generate a new link and try again. Sorry for the inconvenience 🤦",
}) })
res.end(output) res.send(output)
return return
} }
} }
@ -390,7 +390,7 @@ router.get('/verify', async (req, res) => {
error: "That pledge was not found in our records. Are you sure you made it? 🔎", error: "That pledge was not found in our records. Are you sure you made it? 🔎",
}) })
res.end(output) res.send(output)
return return
} else { } else {
@ -398,7 +398,7 @@ router.get('/verify', async (req, res) => {
error: "An unknown error occurred. Please generate a new link and try again. Sorry for the inconvenience 🤦", error: "An unknown error occurred. Please generate a new link and try again. Sorry for the inconvenience 🤦",
}) })
res.end(output) res.send(output)
return return
} }
} }
@ -474,7 +474,7 @@ The Snipette Team`
router.get('/thanks', async (req, res) => { router.get('/thanks', async (req, res) => {
let output = await twing.render('thanks.htm.twig') let output = await twing.render('thanks.htm.twig')
res.end(output) res.send(output)
return return
}) })