Updates to the website to remove Yaks and AP classes; Updates to the admin site to support user management (not working fully yet).
This commit is contained in:
@@ -94,7 +94,7 @@ module.exports = function(app, rootPath, passport, smtpTransport, sequelize) {
|
||||
});
|
||||
}
|
||||
else {
|
||||
console.log("Looking for index.ejs in " + adminPath);
|
||||
//console.log("Looking for index.ejs in " + adminPath);
|
||||
//res.render("index.ejs", {root: adminPath});
|
||||
res.render(path.join(adminPath, req.baseUrl, "index"));
|
||||
}
|
||||
@@ -181,6 +181,26 @@ module.exports = function(app, rootPath, passport, smtpTransport, sequelize) {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
app.get('/admin/user-data', isLoggedIn, function(req, res) {
|
||||
try {
|
||||
if(req.user.admin) {
|
||||
sequelize.models.User.findAll().then(function(values) {
|
||||
res.json(values);
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
}
|
||||
catch(e) {console.log(e);}
|
||||
});
|
||||
|
||||
app.post('/admin/createUser', isLoggedIn, function(req, res) {
|
||||
try {
|
||||
res.json({status: 'success'});
|
||||
} catch(e) {console.log(e);}
|
||||
});
|
||||
|
||||
app.get('/admin/getCategories', isLoggedIn, function(req, res) {
|
||||
sequelize.models.Category.findAll({attributes: ['id', 'name', 'visible'], order: [['name', 'DESC'], ['visible', 'DESC']]}).then(function(values) {
|
||||
|
||||
Reference in New Issue
Block a user