mirror of
https://github.com/donl/plivo-node.git
synced 2026-06-30 06:12:08 -06:00
Add logic to handle all params in one object
This commit is contained in:
parent
53c6bd3002
commit
3a84a6bcbe
1 changed files with 9 additions and 3 deletions
|
|
@ -51,8 +51,8 @@ export class MessageInterface extends PlivoResourceInterface {
|
|||
* @promise {object} return {@link PlivoGenericMessage} object if success
|
||||
* @fail {Error} return Error
|
||||
*/
|
||||
send(src, dst, text, optionalParams) {
|
||||
return this.create(src, dst, text, optionalParams);
|
||||
send(optionalParams) {
|
||||
return this.create(optionalParams);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -69,7 +69,13 @@ export class MessageInterface extends PlivoResourceInterface {
|
|||
* @promise {object} return {@link PlivoGenericMessage} object if success
|
||||
* @fail {Error} return Error
|
||||
*/
|
||||
create(src, dst, text, optionalParams, powerpackUUID) {
|
||||
create(optionalParams) {
|
||||
|
||||
var src = optionalParams.src;
|
||||
var dst = optionalParams.dst;
|
||||
var text = optionalParams.text;
|
||||
var powerpackUUID = optionalParams.powerpackUUID;
|
||||
|
||||
let errors = validate([
|
||||
{ field: 'dst', value: dst, validators: ['isRequired'] },
|
||||
{ field: 'text', value: text, validators: ['isRequired'] },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue