From f4a8f493bc0757c4e4e6a1986681054fcfee3186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20My=C5=9Bliwiec?= Date: Wed, 10 Feb 2021 09:24:05 +0100 Subject: [PATCH] fix(platform-fastify): return res.view from handler #6363 --- packages/core/router/router-execution-context.ts | 6 +++++- packages/core/router/router-response-controller.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/core/router/router-execution-context.ts b/packages/core/router/router-execution-context.ts index 4d17c590fd8..9d326078311 100644 --- a/packages/core/router/router-execution-context.ts +++ b/packages/core/router/router-execution-context.ts @@ -413,7 +413,11 @@ export class RouterExecutionContext { const renderTemplate = this.reflectRenderTemplate(callback); if (renderTemplate) { return async (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') { diff --git a/packages/core/router/router-response-controller.ts b/packages/core/router/router-response-controller.ts index 990c0707e35..374606f0203 100644 --- a/packages/core/router/router-response-controller.ts +++ b/packages/core/router/router-response-controller.ts @@ -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) {