|
|
|
@ -7,7 +7,7 @@ const book = new Book();
|
|
|
|
|
//--------------------------
|
|
|
|
|
// SETTINGS
|
|
|
|
|
//--------------------------
|
|
|
|
|
router.get('/', function(req, res) {
|
|
|
|
|
router.get('/', function (req, res) {
|
|
|
|
|
if (req.session.user) {
|
|
|
|
|
var nav = [];
|
|
|
|
|
book.getPage()
|
|
|
|
@ -20,7 +20,8 @@ router.get('/', function(req, res) {
|
|
|
|
|
id: item.id,
|
|
|
|
|
uuid: item.uuid,
|
|
|
|
|
title: item.title,
|
|
|
|
|
slug: item.slug
|
|
|
|
|
slug: item.slug,
|
|
|
|
|
path: item.path
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -34,7 +35,8 @@ router.get('/', function(req, res) {
|
|
|
|
|
id: item.id,
|
|
|
|
|
uuid: item.uuid,
|
|
|
|
|
title: item.title,
|
|
|
|
|
slug: item.slug
|
|
|
|
|
slug: item.slug,
|
|
|
|
|
path: item.path
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
for (let i = 0; i < newpages.length; i++) {
|
|
|
|
@ -45,7 +47,8 @@ router.get('/', function(req, res) {
|
|
|
|
|
id: newpages[i].id,
|
|
|
|
|
uuid: newpages[i].uuid,
|
|
|
|
|
title: newpages[i].title,
|
|
|
|
|
slug: newpages[i].slug
|
|
|
|
|
slug: newpages[i].slug,
|
|
|
|
|
path: newpages[i].path
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -59,6 +62,7 @@ router.get('/', function(req, res) {
|
|
|
|
|
})
|
|
|
|
|
.catch(err => {
|
|
|
|
|
//console.log('ERROR', err);
|
|
|
|
|
//render error pages
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
res.redirect('/@/dashboard');
|
|
|
|
|