-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
docs: add explicit provider registration of new services in prisma recipe #2912
base: master
Are you sure you want to change the base?
Conversation
content/recipes/prisma.md
Outdated
@@ -391,6 +391,21 @@ export class PostService { | |||
|
|||
Your `UserService` and `PostService` currently wrap the CRUD queries that are available in Prisma Client. In a real world application, the service would also be the place to add business logic to your application. For example, you could have a method called `updatePassword` inside the `UserService` that would be responsible for updating the password of a user. | |||
|
|||
We need to register the new services with Nest so that it can perform the injection. We do this by editing our module file (`app.module.ts`) and adding the new services to the `providers` array of the `@Module()` decorator. | |||
|
|||
```typescript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we need to show any code for this here as registering providers is pretty standard in nestjs apps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@micalevisk I followed along the recipe, tried to run the app and ran into the error. What do you think about just mentioning it and leaving out the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah we can have that mention to recall the dev, but the code itself is redundant here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I adapted the change accordingly. Does it work like this for you?
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Does this PR introduce a breaking change?