Use arrow function to take advantage of bound context
This commit is contained in:
parent
90c4796d4e
commit
1959a841fd
@ -21,8 +21,7 @@ function getPGTypeName (pgType) {
|
||||
|
||||
module.exports = class BaseDataview {
|
||||
getResult (psql, override, callback) {
|
||||
const self = this;
|
||||
this.sql(psql, override, function(err, query) {
|
||||
this.sql(psql, override, (err, query) => {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
@ -32,8 +31,8 @@ module.exports = class BaseDataview {
|
||||
return callback(err, result);
|
||||
}
|
||||
|
||||
result = self.format(result, override);
|
||||
result.type = self.getType();
|
||||
result = this.format(result, override);
|
||||
result.type = this.getType();
|
||||
|
||||
return callback(null, result);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user