From 66dfc73259562be03016fa961a680a1bd0cf2f39 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Sat, 25 Jun 2016 01:39:44 +0200 Subject: [PATCH] bugfixes :bug --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 0bee41ac..f28f7647 100644 --- a/index.js +++ b/index.js @@ -9,9 +9,9 @@ const onData = (d) => { if (!d.common) return d const c = d.common if (Array.isArray(c.locL)) d.locations = c.locL.map(parse.location) - if (Array.isArray(c.prodL)) d.locations = c.prodL.map(parse.product) - if (Array.isArray(c.remL)) d.locations = c.remL.map(parse.remark) - if (Array.isArray(c.opL)) d.locations = c.opL.map(parse.agency) + if (Array.isArray(c.prodL)) d.products = c.prodL.map(parse.product) + if (Array.isArray(c.remL)) d.remarks = c.remL.map(parse.remark) + if (Array.isArray(c.opL)) d.agencies = c.opL.map(parse.agency) return d } @@ -26,7 +26,7 @@ const request = (cfg) => (data) => { 'Accept-Encoding': 'gzip, deflate' } } - if (cfg.req) req = cfg.req(req) + if (cfg.onReq) req = cfg.onReq(req) return got.post(cfg.endpoint, req) .then((res) => {