Skip to content

Commit

Permalink
fix(ControllerGenerator): check void type
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhck authored and paibamboo committed Sep 25, 2017
1 parent 4a3d633 commit 5184162
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/TypeScriptGenerator/TsControllerGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class TsControllerGenerator implements IGenerator {
paramsAndOptions = `options?: IFetchRequest`;
}

const returnType = `Promise<${this.prefix + apiMethod.returnType.toPascalCase()}>`;
const returnType = `Promise<${apiMethod.returnType === "void" ? "void" : this.prefix + apiMethod.returnType.toPascalCase()}>`;
let parent: ICode = new Code(`public ${apiMethod.name.toCamelCase()}(${paramsAndOptions}): ${returnType}`);
let fetchRequestString: string = `return this.client.process({...${this.getFetchRequestString(apiMethod)}, ...options} as IFetchRequest);`;
let child: ICode = new Code(fetchRequestString);
Expand Down

0 comments on commit 5184162

Please sign in to comment.