From 716d2e017fa7986d460ebe9b4caca4488c4c2003 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sun, 8 Mar 2020 09:56:46 -0700 Subject: [PATCH] fix(_this): Using _this instead of this --- src/routes/v3/full-node/control.js | 13 +++++++------ src/routes/v3/full-node/mining.js | 15 ++++++++------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/routes/v3/full-node/control.js b/src/routes/v3/full-node/control.js index 310da58..3bd6df1 100644 --- a/src/routes/v3/full-node/control.js +++ b/src/routes/v3/full-node/control.js @@ -20,12 +20,13 @@ let _this class Control { constructor () { _this = this - this.axios = axios - this.routeUtils = routeUtils - this.router = router - this.router.get('/', this.root) - this.router.get('/getNetworkInfo', this.getNetworkInfo) + _this.axios = axios + _this.routeUtils = routeUtils + + _this.router = router + _this.router.get('/', _this.root) + _this.router.get('/getNetworkInfo', _this.getNetworkInfo) } root (req, res, next) { @@ -65,7 +66,7 @@ class Control { try { // const response = await BitboxHTTP(requestConfig) - const response = await this.axios.request(options) + const response = await _this.axios.request(options) return res.json(response.data.result) } catch (error) { diff --git a/src/routes/v3/full-node/mining.js b/src/routes/v3/full-node/mining.js index 89461c7..b8346bf 100644 --- a/src/routes/v3/full-node/mining.js +++ b/src/routes/v3/full-node/mining.js @@ -18,13 +18,14 @@ let _this class Mining { constructor () { _this = this - this.axios = axios - this.routeUtils = routeUtils - this.router = router - this.router.get('/', this.root) - this.router.get('/getMiningInfo', this.getMiningInfo) - this.router.get('/getNetworkHashPS', this.getNetworkHashPS) + _this.axios = axios + _this.routeUtils = routeUtils + + _this.router = router + _this.router.get('/', _this.root) + _this.router.get('/getMiningInfo', _this.getMiningInfo) + _this.router.get('/getNetworkHashPS', _this.getNetworkHashPS) } root (req, res, next) { @@ -124,7 +125,7 @@ class Mining { options.data.method = 'getnetworkhashps' options.data.params = [nblocks, height] - const response = await this.axios.request(options) + const response = await _this.axios.request(options) return res.json(response.data.result) } catch (err) {