mirror of
https://github.com/donl/plivo-node.git
synced 2026-06-04 22:07:01 -06:00
Update powerpacks.js
This commit is contained in:
parent
c81dfc7e26
commit
c7f3b24f77
1 changed files with 1 additions and 23 deletions
|
|
@ -697,29 +697,7 @@ export class PowerpackInterface extends PlivoResourceInterface {
|
|||
* @fail {Error} return Error
|
||||
*/
|
||||
get(uuid) {
|
||||
let errors = validate([{
|
||||
field: 'uuid',
|
||||
value: uuid,
|
||||
validators: ['isRequired']
|
||||
}]);
|
||||
|
||||
if (errors) {
|
||||
return errors;
|
||||
}
|
||||
|
||||
let client = this[clientKey];
|
||||
return new Promise((resolve, reject) => {
|
||||
if (action !== '' && !uuid) {
|
||||
reject(new Error(this[idKey] + ' must be set'));
|
||||
}
|
||||
client('GET', action + (uuid ? uuid + '/' : ''))
|
||||
.then(response => {
|
||||
resolve(new PlivoGenericResponse(response.body, client));
|
||||
})
|
||||
.catch(error => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
return super.get(uuid);
|
||||
}
|
||||
/**
|
||||
* create Powerpack
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue