summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-03-25 16:44:29 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2017-03-25 16:44:29 +0100
commit3e5b13b58c976117c0862228bf0d9493f398eb87 (patch)
treea89a69888fc19d6b3391321f3d9bd753cd71af69
parent3804a30ffe7e169665bcd0732738109ea5dd1061 (diff)
downloadbridge-3e5b13b58c976117c0862228bf0d9493f398eb87.tar.gz
bridge-3e5b13b58c976117c0862228bf0d9493f398eb87.zip
fix API search
-rw-r--r--api.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/api.js b/api.js
index 9fcef82..eaf3424 100644
--- a/api.js
+++ b/api.js
@@ -47,12 +47,11 @@ async function api_playerByAttr(attr, val) {
"X-Title-Id": "semc-vainglory",
"Authorization": APITOKEN
},
- qs: {
- filter: val
- },
+ qs: {},
json: true,
gzip: true
};
+ options.qs[filter] = val;
try {
res = await request(options);
finds.push({
@@ -62,6 +61,9 @@ async function api_playerByAttr(attr, val) {
"source": "api"
});
} catch (err) {
+ if (err.statusCode != 404) {
+ console.error(err);
+ }
// TODO
}
}