-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: add defineCrudRepositoryClass #3867
Conversation
@hacksparrow I am confused. The pull request says "Add defineCrudRepositoryClass - a helper to create named repository classes", but then it changes 24 files and introduces also a booter class. Can you please check? |
c498c64
to
f36784d
Compare
@bajtos PTAL, updated. |
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.
The code changes look reasonable. Please add a new section to README
to show how to use this new API.
f36784d
to
32e6de5
Compare
32e6de5
to
13749fe
Compare
13749fe
to
0347afc
Compare
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.
👍
e15cdb0
to
52c3020
Compare
b2d9b60
to
bc42658
Compare
0686f2c
to
fce609b
Compare
packages/rest-crud/README.md
Outdated
```ts | ||
const db = new juggler.DataSource({connector: 'memory'}); | ||
const ProductRepository = defineCrudRepositoryClass(Product); | ||
const repo = new ProductRepository(db); |
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 find it confusing that the Controller section is showing DI + app.controller, but the Repository section is showing manual approach, which also does not take into account different lifetimes of a datasource (one instance for entire app life) vs. a repository (new repository created for each request).
fce609b
to
38b902d
Compare
Add `defineCrudRepositoryClass` - a helper to create named repository classes
38b902d
to
091d8c4
Compare
Add
defineCrudRepositoryClass
- a helper to create named repository classes.Addresses #3733.
Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated👉 Check out how to submit a PR 👈