viraxslot / online-school-app

Backend for testing purposes.
0 stars 0 forks source link

Should teacher be able to change course if values in PATCH request equal initial values? #50

Closed LarisaTerenteva closed 2 years ago

LarisaTerenteva commented 2 years ago

Is your feature request related to a problem? Please describe. It is now implemented, that PATCH request for a course if PATCH request values equal initial values, get as a result code 200 Ok and response body in which all the initial values are returned (initial course is created and then being changed by the same teacher user).

Describe the solution you'd like Please consider adding an error message, saying that no changes have been applied, and changing response code to 400.

Describe alternatives you've considered Actual implementation seems to be an alternative variant, but I propose, that in some way, user should be informed about whether the values are being changed or not.

Additional context

viraxslot commented 2 years ago

Please consider adding an error message, saying that no changes have been applied, and changing response code to 400.

400 bad request error should show us that the request has been sent in the wrong form. It doesn't fit the described case because the request body is totally ok.

I'd say it's better to place this logic in the frontend part because backend does what is expected.

LarisaTerenteva commented 2 years ago

I'd say it's better to place this logic in the frontend part because backend does what is expected.

That sounds as a better idea, I agree.