Skip to content

Commit

Permalink
fix(platform-fastify): return res.view from handler #6363
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Feb 10, 2021
1 parent a60491d commit f4a8f49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/core/router/router-execution-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,11 @@ export class RouterExecutionContext {
const renderTemplate = this.reflectRenderTemplate(callback);
if (renderTemplate) {
return async <TResult, TResponse>(result: TResult, res: TResponse) => {
await this.responseController.render(result, res, renderTemplate);
return await this.responseController.render(
result,
res,
renderTemplate,
);
};
}
if (redirectResponse && typeof redirectResponse.url === 'string') {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/router/router-response-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class RouterResponseController {
template: string,
) {
const result = await this.transformToResult(resultOrDeferred);
this.applicationRef.render(response, template, result);
return this.applicationRef.render(response, template, result);
}

public async transformToResult(resultOrDeferred: any) {
Expand Down

0 comments on commit f4a8f49

Please sign in to comment.