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 e0f6690 commit 53c545a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 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.1.0",
"version": "5.2.0",
"description": "The Athenna Http server. Built on top of fastify.",
"license": "MIT",
"author": "João Lenon <[email protected]>",
Expand Down
4 changes: 3 additions & 1 deletion src/context/Response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ export class Response {
* ```
*/
public async view(view: string, data?: any): Promise<Response> {
const content = await View.render(view, { ...data, request: this.request })
View.edge.share({ request: this.request })

const content = await View.render(view, data)

await this.safeHeader('Content-Type', 'text/html; charset=utf-8').send(
content
Expand Down

0 comments on commit 53c545a

Please sign in to comment.