Browse Source

rollback string replace

- move condition from ternary op to if
pull/12330/head
muhammedaltug 4 years ago
parent
commit
7dd744137c
  1. 9
      npm/ng-packs/packages/schematics/src/models/method.ts
  2. 2
      npm/ng-packs/packages/schematics/src/utils/service.ts

9
npm/ng-packs/packages/schematics/src/models/method.ts

@ -47,11 +47,12 @@ export class Body {
const { bindingSourceId, descriptorName, jsonName, name, nameOnMethod } = param;
const camelName = camel(name);
const paramName = jsonName || camelName;
const value = descriptorName
? shouldQuote(paramName)
let value = camelizeHyphen(nameOnMethod);
if (descriptorName) {
value = shouldQuote(paramName)
? `${descriptorName}['${paramName}']`
: `${descriptorName}.${paramName}`
: camelizeHyphen(nameOnMethod);
: `${descriptorName}.${paramName}`;
}
switch (bindingSourceId) {
case eBindingSourceId.Model:

2
npm/ng-packs/packages/schematics/src/utils/service.ts

@ -99,7 +99,7 @@ export function createActionToSignatureMapper() {
}
function getMethodNameFromAction(action: Action): string {
return action.uniqueName.replace('Async', '');
return action.uniqueName.split('Async')[0];
}
function getVersionParameter(action: Action) {

Loading…
Cancel
Save