Skip to content

Commit

Permalink
feat(view): share request instead object
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Nov 18, 2024
1 parent 53c545a commit 215b96e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
Expand Down
7 changes: 4 additions & 3 deletions src/context/Response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,10 @@ export class Response {
* ```
*/
public async view(view: string, data?: any): Promise<Response> {
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
Expand Down

0 comments on commit 215b96e

Please sign in to comment.