refactor: use group.slug on acp group urls closes #8277

isekai-main
Barış Soner Uşaklı 2 years ago
parent b663c620ce
commit 14c79763dd

@ -9,6 +9,7 @@ const groups = require('../../groups');
const meta = require('../../meta');
const pagination = require('../../pagination');
const events = require('../../events');
const slugify = require('../../slugify');
const groupsController = module.exports;
@ -31,7 +32,8 @@ groupsController.list = async function (req, res) {
};
groupsController.get = async function (req, res, next) {
const groupName = req.params.name;
const slug = slugify(req.params.name);
const groupName = await groups.getGroupNameByGroupSlug(slug);
const [groupNames, group] = await Promise.all([
getGroupNames(),
groups.get(groupName, { uid: req.uid, truncateUserList: true, userListCount: 20 }),

@ -21,7 +21,7 @@
<!-- BEGIN groups -->
<tr data-groupname="{groups.displayName}" data-name-encoded="{groups.nameEncoded}">
<td>
<a href="{config.relative_path}/admin/manage/groups/{groups.nameEncoded}">{groups.displayName}</a> ({groups.memberCount})
<a href="{config.relative_path}/admin/manage/groups/{groups.slug}">{groups.displayName}</a> ({groups.memberCount})
<p class="description">{groups.description}</p>
</td>
<td>

Loading…
Cancel
Save