mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 23:56:04 +02:00
feat: move website/location fields into custom user fields
This commit is contained in:
@@ -94,9 +94,10 @@ async function getUsers(req, res) {
|
||||
|
||||
const set = buildSet();
|
||||
const uids = await getUids(set);
|
||||
const [count, users] = await Promise.all([
|
||||
const [count, users, customUserFields] = await Promise.all([
|
||||
getCount(set),
|
||||
loadUserInfo(req.uid, uids),
|
||||
getCustomUserFields(),
|
||||
]);
|
||||
|
||||
await render(req, res, {
|
||||
@@ -106,9 +107,15 @@ async function getUsers(req, res) {
|
||||
resultsPerPage: resultsPerPage,
|
||||
reverse: reverse,
|
||||
sortBy: sortBy,
|
||||
customUserFields,
|
||||
});
|
||||
}
|
||||
|
||||
async function getCustomUserFields() {
|
||||
const keys = await db.getSortedSetRange('user-custom-fields', 0, -1);
|
||||
return (await db.getObjects(keys.map(k => `user-custom-field:${k}`))).filter(Boolean);
|
||||
}
|
||||
|
||||
usersController.search = async function (req, res) {
|
||||
const sortDirection = req.query.sortDirection || 'desc';
|
||||
const reverse = sortDirection === 'desc';
|
||||
|
||||
Reference in New Issue
Block a user