HospitalRun / hospitalrun-server

Backend for HospitalRun
https://hospitalrun.io
MIT License
876 stars 642 forks source link

Do not use POST requests for everything #3

Closed phanimahesh closed 8 years ago

phanimahesh commented 8 years ago

Most routes are use HTTP POST even to fetch a resource, which does not conform to REST philosophy. They should be rewritten to use the appropriate HTTP verbs based on their function.

From a very cursory examination, /chkuser, /getuser and /allusers should be GET, /deleteusers should be DELETE and /updateuser should be a PUT/PATCH request.

The changes are minimal, I can submit a PR if you are interested.

turboMaCk commented 8 years ago

I agree that using GET/PUT(or PATCH)/POST/DELETE is better for these and much more RESTlike. The question is how this will affect FE's adapter.

phanimahesh commented 8 years ago

Which FE adapter are you referring to?

turboMaCk commented 8 years ago

https://github.com/HospitalRun/hospitalrun-frontend/blob/master/app/adapters/application.js https://github.com/HospitalRun/hospitalrun-frontend/blob/master/app/adapters/user.js and also: https://github.com/HospitalRun/hospitalrun-frontend/blob/master/server/routes/couchuser.js#L98

jkleinsc commented 8 years ago

The routes in question are no longer needed on the server (see HospitalRun/hospitalrun-frontend@f185df149874a8ee9527fc8dd832ee1ef15a1432 and HospitalRun/hospitalrun-frontend@8b6a26da4414d6797c4ae115205032a24e6265b4) and they will be removed from the server

ghost commented 5 years ago

:tada: This issue has been resolved in version 1.0.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

ghost commented 5 years ago

:tada: This issue has been resolved in version 1.0.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: