UWA-MIT / image-store

Buy sell images generated by AI. This project is a group project for CITS5505 - Agile Web Development course at UWA for Masters of IT students.
0 stars 1 forks source link

Change route "/edit_profile" to "/user/<username>/edit" to follow the right routing #30

Open ktagintsev opened 7 months ago

ktagintsev commented 7 months ago

https://github.com/UWA-MIT/image-store/blob/2333bd42f44e337f0f26a98372e1313367ad7926/app/users/routes.py#L38

rayhan commented 7 months ago

I think the current route is ok as only current user can edit the profile. Hence no need to change it to username/edit.

However, route user/ is for view profile because this view profile may be made available for other users like twitter/facebook.

ktagintsev commented 7 months ago

I think the current route is ok as only current user can edit the profile. Hence no need to change it to username/edit.

However, route user/ is for view profile because this view profile may be made available for other users like twitter/facebook.

I think it is not ok "/users/edit_profile" should be "users/username/edit" that is why:

The approach "users/username/edit" is more scalable and RESTful, aligning with web standards for resource-oriented architecture. For example, it's particularly useful in scenarios where administrators or certain users have the permissions to edit other users' profiles which our project maybe will have in the future:)

rayhan commented 6 months ago

I respectfully disagree with this explanation. Firstly, the route "/users/username/edit" deviates from RESTful conventions, which are based on resource-oriented architecture. If there are solid documents supporting this argument, I would appreciate sharing them with me. Secondly, the "edit" feature is specifically designed for the current user to edit their profile, and it does not necessarily conform to the public convention of "/users/username/edit." I believe maintaining the current approach is preferable. Thank you for considering my perspective.