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

Add Put Routes in CrudController #107

Closed
RobotScribe opened this issue Jun 18, 2019 · 6 comments
Closed

Add Put Routes in CrudController #107

RobotScribe opened this issue Jun 18, 2019 · 6 comments

Comments

@RobotScribe
Copy link
Contributor

RobotScribe commented Jun 18, 2019

On my project, we use PUT to update entities and we would like to use this library to generate new routes.

Is it possible to add a method which would use a PUT routes in the CrudController.

As a side question, why did you chose to use PATCH routes to update entities over PUT ?

@Diluka
Copy link
Contributor

Diluka commented Jun 19, 2019

  • PATCH means partial update.
  • PUT means completely update or insert new one.

crud update record partially, so there is PATCH.
And I also know some clients doesn't support PATCH method.

@RobotScribe
Copy link
Contributor Author

It is not possible to add PUTmethod ?
I can make a PR if you like.

@Diluka
Copy link
Contributor

Diluka commented Jun 19, 2019

Considering compatibility and business scenarios, we also often use PUT to do PATCH at work. But this violates the definition of RESTful. @zMotivat0r Your call.

RobotScribe added a commit to RobotScribe/crud that referenced this issue Jun 19, 2019
Add Put Routes in CrudController nestjsx#107
@RobotScribe
Copy link
Contributor Author

In case you agree I created a PR : #109

@michaelyali
Copy link
Member

@RobotScribe as soon as my comments in that PR is resolved I'll merge. Thanks!

RobotScribe added a commit to RobotScribe/crud that referenced this issue Jun 24, 2019
Add Put Routes in CrudController nestjsx#107
@michaelyali
Copy link
Member

added in 4.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants