mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
refactor: use group.slug on acp group urls closes #8277
This commit is contained in:
@@ -9,6 +9,7 @@ const groups = require('../../groups');
|
|||||||
const meta = require('../../meta');
|
const meta = require('../../meta');
|
||||||
const pagination = require('../../pagination');
|
const pagination = require('../../pagination');
|
||||||
const events = require('../../events');
|
const events = require('../../events');
|
||||||
|
const slugify = require('../../slugify');
|
||||||
|
|
||||||
const groupsController = module.exports;
|
const groupsController = module.exports;
|
||||||
|
|
||||||
@@ -31,7 +32,8 @@ groupsController.list = async function (req, res) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
groupsController.get = async function (req, res, next) {
|
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([
|
const [groupNames, group] = await Promise.all([
|
||||||
getGroupNames(),
|
getGroupNames(),
|
||||||
groups.get(groupName, { uid: req.uid, truncateUserList: true, userListCount: 20 }),
|
groups.get(groupName, { uid: req.uid, truncateUserList: true, userListCount: 20 }),
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<!-- BEGIN groups -->
|
<!-- BEGIN groups -->
|
||||||
<tr data-groupname="{groups.displayName}" data-name-encoded="{groups.nameEncoded}">
|
<tr data-groupname="{groups.displayName}" data-name-encoded="{groups.nameEncoded}">
|
||||||
<td>
|
<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>
|
<p class="description">{groups.description}</p>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
Reference in New Issue
Block a user