mirror of https://github.com/calzoneman/sync.git
Use a more salient variable name.
Use a style thats readable with brevity.
This commit is contained in:
parent
93ef067b8c
commit
1d65eb036e
13
src/acp.js
13
src/acp.js
|
@ -91,15 +91,10 @@ function handleGlobalBanDelete(user, data) {
|
|||
}
|
||||
|
||||
function handleListUsers(user, data) {
|
||||
var query = data.query;
|
||||
if (typeof query !== "string") {
|
||||
query = "";
|
||||
}
|
||||
|
||||
var value = data.value;
|
||||
var field = data.field;
|
||||
if (typeof field !== "string") {
|
||||
field = "name";
|
||||
}
|
||||
value = (typeof value !== 'string') ? '' : value;
|
||||
field = (typeof field !== 'string') ? 'name' : field;
|
||||
|
||||
var fields = ["id", "name", "global_rank", "email", "ip", "time"];
|
||||
|
||||
|
@ -110,7 +105,7 @@ function handleListUsers(user, data) {
|
|||
return;
|
||||
}
|
||||
|
||||
db.users.search(field, query, fields, function (err, users) {
|
||||
db.users.search(field, value, fields, function (err, users) {
|
||||
if (err) {
|
||||
user.socket.emit("errMessage", {
|
||||
msg: err
|
||||
|
|
|
@ -143,7 +143,7 @@ socket.on("acp-gbanlist", function (bans) {
|
|||
}
|
||||
}
|
||||
socket.emit("acp-list-users", {
|
||||
query: $("#acp-ulookup-query").val(),
|
||||
value: $("#acp-ulookup-query").val(),
|
||||
field: $(this).data()["field"]
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue