story-content: Added remove story modal, added annotations

This commit is contained in:
2018-09-23 13:08:55 +02:00
parent df1295e7a6
commit 564192c76d
10 changed files with 171 additions and 6 deletions
+8 -4
View File
@@ -3,11 +3,15 @@ module.exports = (req, res, next) => {
res.markoAsync = async(template, input) => {
const locals = Object.assign((res.locals || {}), input)
for (const key in locals) {
const value = locals[key]
if (value instanceof Promise) {
locals[key] = await value
try {
for (const key in locals) {
const value = locals[key]
if (value instanceof Promise) {
locals[key] = await value
}
}
} catch(err) {
return res.status(404).json(err)
}
return res.marko(template, locals)