feat: add privileges shortcut to groups list

fix issues with escape group names
This commit is contained in:
Barış Soner Uşaklı
2020-07-30 12:26:37 -04:00
parent fcdbdf63a3
commit 91411cc47c
10 changed files with 104 additions and 33 deletions

View File

@@ -21,13 +21,15 @@ groupsController.list = async function (req, res) {
const pageCount = Math.ceil(groupNames.length / groupsPerPage);
const start = (page - 1) * groupsPerPage;
const stop = start + groupsPerPage - 1;
groupNames = groupNames.slice(start, stop + 1);
const allCategories = await categories.buildForSelectAll();
const groupData = await groups.getGroupsData(groupNames);
res.render('admin/manage/groups', {
groups: groupData,
pagination: pagination.create(page, pageCount),
yourid: req.uid,
categories: allCategories,
});
};