Use a more salient variable name.

Use a style thats readable with brevity.
This commit is contained in:
Xaekai 2017-05-24 19:08:53 -07:00
parent 93ef067b8c
commit 1d65eb036e
2 changed files with 5 additions and 10 deletions

View File

@ -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

View File

@ -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"]
});
};