Skip to content

Commit

Permalink
fix: don't support callback as first arg when params are required in …
Browse files Browse the repository at this point in the history
…node (#388)
  • Loading branch information
childish-sambino authored Jan 6, 2023
1 parent ebf9634 commit f2081a8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions examples/node/lib/rest/api/v2010/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,7 @@ export class AccountContextImpl implements AccountContext {
}

update(
params:
| AccountContextUpdateOptions
| ((error: Error | null, item?: AccountInstance) => any),
params: AccountContextUpdateOptions,
callback?: (error: Error | null, item?: AccountInstance) => any
): Promise<AccountInstance> {
if (params === null || params === undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ export class FeedbackCallSummaryContextImpl
}

update(
params:
| FeedbackCallSummaryContextUpdateOptions
| ((error: Error | null, item?: FeedbackCallSummaryInstance) => any),
params: FeedbackCallSummaryContextUpdateOptions,
callback?: (error: Error | null, item?: FeedbackCallSummaryInstance) => any
): Promise<FeedbackCallSummaryInstance> {
if (params === null || params === undefined) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/twilio-node/api-single.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class {{apiName}}ContextImpl implements {{apiName}}Context {
{{/dependents}}
{{#operations}}
{{#vendorExtensions.x-is-context-operation}}
{{vendorExtensions.x-name-lower}}({{#hasParams}}params{{^hasRequiredParams}}?{{/hasRequiredParams}}: {{#bodyParam}}{{dataType}}{{/bodyParam}}{{^bodyParam}}{{vendorExtensions.x-resource-name}}{{vendorExtensions.x-name}}Options{{/bodyParam}} | ((error: Error | null, item?: {{returnType}}) => any), {{/hasParams}}callback?: (error: Error | null, item?: {{returnType}}) => any): Promise<{{returnType}}> {
{{vendorExtensions.x-name-lower}}({{#hasParams}}params{{^hasRequiredParams}}?{{/hasRequiredParams}}: {{#bodyParam}}{{dataType}}{{/bodyParam}}{{^bodyParam}}{{vendorExtensions.x-resource-name}}{{vendorExtensions.x-name}}Options{{/bodyParam}}{{^hasRequiredParams}} | ((error: Error | null, item?: {{returnType}}) => any){{/hasRequiredParams}}, {{/hasParams}}callback?: (error: Error | null, item?: {{returnType}}) => any): Promise<{{returnType}}> {
{{>operation}}
}

Expand Down

0 comments on commit f2081a8

Please sign in to comment.