Update powerpacks.js

This commit is contained in:
Mohammed Huzaif 2021-08-11 18:30:06 +05:30 committed by GitHub
parent c81dfc7e26
commit c7f3b24f77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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