mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-22 09:12:05 -07:00
Merge pull request #113 from christroutner/unstable
fix(_this): Using _this instead of this
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user