Cleaned adminPanel and started adding User mgmt
This commit is contained in:
parent
cde60bb78d
commit
064109556c
11 changed files with 153 additions and 54 deletions
|
|
@ -16,15 +16,17 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
|||
|
||||
//Config
|
||||
const config = require('../../config.json');
|
||||
const userModel = require('../schemas/userSchema');
|
||||
const channelModel = require('../schemas/channelSchema');
|
||||
const {exceptionHandler} = require("../utils/loggerUtils");
|
||||
|
||||
//register page functions
|
||||
module.exports.get = async function(req, res){
|
||||
try{
|
||||
const chanGuide = await channelModel.getChannelList(true);
|
||||
return res.render('adminPanel', {instance: config.instanceName, user: req.session.user, chanGuide: chanGuide});
|
||||
const userList = await userModel.getUserList(true);
|
||||
return res.render('adminPanel', {instance: config.instanceName, user: req.session.user, chanGuide: chanGuide, userList: userList});
|
||||
}catch(err){
|
||||
res.status(500);
|
||||
return res.send("Error indexing channels!");
|
||||
return exceptionHandler(res,err);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue