mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 06:46:02 +02:00
Squashed commit of the following:
commitafd96a00b1Author: Barış Soner Uşaklı <barisusakli@gmail.com> Date: Thu Nov 7 10:42:33 2024 -0500 chore: up themes commitb40e530434Author: Barış Soner Uşaklı <barisusakli@gmail.com> Date: Wed Nov 6 19:16:44 2024 -0500 feat: add min:rep to custom fields add validation in profile.update commit4b5cb613e5Author: Barış Soner Uşaklı <barisusakli@gmail.com> Date: Wed Nov 6 12:03:22 2024 -0500 test: add openapi spec, move menu button commit0c551fa240Merge:13f39053c9bc00df3cd9Author: Barış Soner Uşaklı <barisusakli@gmail.com> Date: Wed Nov 6 11:48:05 2024 -0500 Merge branch 'develop' into custom-user-fields commit13f39053c9Author: Barış Soner Uşaklı <barisusakli@gmail.com> Date: Wed Jul 31 00:23:39 2024 -0400 refactor: dont need delete function commitf33c8849d8Author: Barış Soner Uşaklı <barisusakli@gmail.com> Date: Tue Jul 30 21:30:00 2024 -0400 feat: show custom fields on edit/profile commit5e1d8769d4Author: Barış Soner Uşaklı <barisusakli@gmail.com> Date: Tue Jul 30 17:08:25 2024 -0400 feat: add custom user fields acp page
This commit is contained in:
@@ -294,3 +294,15 @@ usersController.getCSV = async function (req, res, next) {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
usersController.customFields = async function (req, res) {
|
||||
const keys = await db.getSortedSetRange('user-custom-fields', 0, -1);
|
||||
const fields = (await db.getObjects(keys.map(k => `user-custom-field:${k}`))).filter(Boolean);
|
||||
fields.forEach((field) => {
|
||||
if (field['select-options']) {
|
||||
field.selectOptionsFormatted = field['select-options'].trim().split('\n').join(', ');
|
||||
}
|
||||
field['min:rep'] = field['min:rep'] || 0;
|
||||
});
|
||||
res.render('admin/manage/users/custom-fields', { fields: fields });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user