Skip to content

Commit

Permalink
fix context render #1
Browse files Browse the repository at this point in the history
  • Loading branch information
andersondanilo committed May 3, 2020
1 parent b06cc3a commit ae67805
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsonapi-fractal",
"version": "1.0.16",
"version": "1.0.17",
"description": "JSON:API Serializer inspired by Fractal (PHP)",
"license": "MIT",
"main": "dist/index",
Expand Down
5 changes: 3 additions & 2 deletions src/Context.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import Tranformer from './Transformer'
import Options from './Options'
import JsonApiResponse from './JsonApiResponse'

export default class Context {
input: any = null;
transformer: Tranformer = null;
included: boolean = false;
options: any = null;
render: (b) => null;
render: (c: Context) => JsonApiResponse;

constructor (render) {
this.render = render;
Expand Down Expand Up @@ -36,7 +37,7 @@ export default class Context {
return this;
}

serialize () {
serialize (): JsonApiResponse {
return this.render(this);
}
}

0 comments on commit ae67805

Please sign in to comment.