mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 06:34:41 +02:00
Standardization work on built in user list module plus docs & code cleanup
* More docs, fix some info * Code cleanup
This commit is contained in:
parent
2e275600b1
commit
e6a812cf34
9 changed files with 102 additions and 80 deletions
10
core/user.js
10
core/user.js
|
@ -537,8 +537,8 @@ module.exports = class User {
|
|||
}
|
||||
|
||||
static getUserList(options, cb) {
|
||||
let userList = [];
|
||||
let orderClause = 'ORDER BY ' + (options.order || 'user_name');
|
||||
const userList = [];
|
||||
const orderClause = 'ORDER BY ' + (options.order || 'user_name');
|
||||
|
||||
userDb.each(
|
||||
`SELECT id, user_name
|
||||
|
@ -562,7 +562,11 @@ module.exports = class User {
|
|||
[ user.userId ],
|
||||
(err, row) => {
|
||||
if(row) {
|
||||
user[row.prop_name] = row.prop_value;
|
||||
if(options.propsCamelCase) {
|
||||
user[_.camelCase(row.prop_name)] = row.prop_value;
|
||||
} else {
|
||||
user[row.prop_name] = row.prop_value;
|
||||
}
|
||||
}
|
||||
},
|
||||
err => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue