From 215b96e2c7af874884d5b4c0c7f0f7e1c28d770c Mon Sep 17 00:00:00 2001 From: jlenon7 Date: Mon, 18 Nov 2024 13:43:05 +0000 Subject: [PATCH] feat(view): share request instead object --- package-lock.json | 4 ++-- package.json | 2 +- src/context/Response.ts | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index df90531..c9252e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@athenna/http", - "version": "5.2.0", + "version": "5.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@athenna/http", - "version": "5.2.0", + "version": "5.3.0", "license": "MIT", "devDependencies": { "@athenna/artisan": "^5.1.0", diff --git a/package.json b/package.json index 73c92ce..94d4bce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athenna/http", - "version": "5.2.0", + "version": "5.3.0", "description": "The Athenna Http server. Built on top of fastify.", "license": "MIT", "author": "João Lenon ", diff --git a/src/context/Response.ts b/src/context/Response.ts index 80cf2c1..e68f46b 100644 --- a/src/context/Response.ts +++ b/src/context/Response.ts @@ -117,9 +117,10 @@ export class Response { * ``` */ public async view(view: string, data?: any): Promise { - View.edge.share({ request: this.request }) - - const content = await View.render(view, data) + const content = await View.edge + .createRenderer() + .share({ request: this.request }) + .render(view, data) await this.safeHeader('Content-Type', 'text/html; charset=utf-8').send( content