From 3e5b13b58c976117c0862228bf0d9493f398eb87 Mon Sep 17 00:00:00 2001 From: schneefux Date: Sat, 25 Mar 2017 16:44:29 +0100 Subject: fix API search --- api.js | 8 +++++--- 1 file 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 } } -- cgit v1.3.1