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