Skip to content

Commit f1bd92e

Browse files
JamesGillerchris-smith
authored andcommitted
Fix bug with hasParam and getParamNames. (#71)
Fix bug with hasParam and getParamNames - both were using an outdated method.
1 parent ce780e7 commit f1bd92e

1 file changed

Lines changed: 8 additions & 18 deletions

File tree

src/lib/ParamServerApiClient.js

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,10 @@ class ParamServerApiClient {
8888
];
8989

9090
return new Promise((resolve, reject) => {
91-
this._xmlrpcClient.methodCall('hasParam', data, (err, resp) => {
92-
if (err || resp[0] !== 1) {
93-
reject(err, resp);
94-
}
95-
else {
96-
// resp[2] is whether it actually has param and presumably all anyone cares about
97-
resolve(resp[2]);
98-
}
99-
});
91+
this._call('hasParam', data, (resp) => {
92+
// resp[2] is whether it actually has param and presumably all anyone cares about
93+
resolve(resp[2]);
94+
}, reject);
10095
});
10196
}
10297

@@ -106,15 +101,10 @@ class ParamServerApiClient {
106101
];
107102

108103
return new Promise((resolve, reject) => {
109-
this._xmlrpcClient.methodCall('getParamNames', data, (err, resp) => {
110-
if (err || resp[0] !== 1) {
111-
reject(err, resp);
112-
}
113-
else {
114-
// resp[2] is parameter name list and presumably all anyone cares about
115-
resolve(resp[2]);
116-
}
117-
});
104+
this._call('getParamNames', data, (resp) => {
105+
// resp[2] is parameter name list and presumably all anyone cares about
106+
resolve(resp[2]);
107+
}, reject);
118108
});
119109
}
120110
}

0 commit comments

Comments
 (0)