Create pledge from translation

This commit is contained in:
2022-01-06 19:44:39 +02:00
parent 0cc2727826
commit 081e5fa018
5 changed files with 166 additions and 10 deletions

View File

@@ -6,10 +6,21 @@ module.exports = function (options) {
router.route('/')
.get(function(request, response, next) {
response.display("pledges", {
user: request.user,
pageTitle: "Library - Mantra"
db.Pledge.findAll({
}).then(pledges => {
if (pledges) {
response.display("pledges", {
user: request.user,
pageTitle: "Pledges - Mantra",
pledges: pledges
})
} else {
next()
}
}).catch(error => {
next(error)
})
})
return router;
};