Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept Context as method parameter in all the methods related to hooks #46

Closed
pratik-techprescient opened this issue Sep 7, 2021 · 3 comments · Fixed by #49
Closed
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@pratik-techprescient
Copy link

Is your feature request related to a problem? Please describe.
Let's say we want to initialize a field (like tenantId, requestId, etc) using request specific context inside hooks, it will not be possible as the hooks do not accept any method parameter. Right now, there is no way to initialize a field of the model inside the hooks, using some value present in context.

Describe the solution you'd like
The hooks should accept one parameter called context. Then methods like create, createWithContext should pass the context parameter to the hooks as well. This will help to use context to initialize the request specific parameters in hooks.

@mehran-prs
Copy link
Member

Hi @pratik-techprescient
Yes, that's a good feature, we'll implement it.
Please feel free to submit a PR for it.

@mehran-prs mehran-prs added enhancement New feature or request help wanted Extra attention is needed labels Sep 8, 2021
@hextechpal
Copy link
Contributor

@mehran-prs I tried to address this issue in my PR. Awaiting your review

@mehran-prs mehran-prs linked a pull request Oct 19, 2021 that will close this issue
@mehran-prs
Copy link
Member

ُThanks to @culturalpal supporting context has been added to hooks, so I think we can close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants