Update base.js

This commit is contained in:
Narayana Shanubhogh 2019-11-14 01:15:59 +05:30 committed by GitHub
parent 1c18f011a8
commit 35326c8b31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,6 +75,34 @@ export class PlivoResource {
});
});
}
customexecuteAction(url, method = 'GET', params = {}) {
let client = this[clientKey];
let idField = this[idKey];
return new Promise((resolve, reject) => {
client(method, url, params)
.then(response => {
resolve(new PlivoGenericResponse(response.body, idField));
})
.catch(error => {
reject(error);
});
});
}
getMetaResponse(url, method = 'GET', params = {}) {
let client = this[clientKey];
let idField = this[idKey];
let count = 0;
return new Promise((resolve, reject) => {
client(method, url, params)
.then(response => {
count = response.body.meta.totalCount;
resolve(count);
})
.catch(error => {
reject(error);
});
});
}
}
export class PlivoResourceInterface {