-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Back-EndBack-End Related TaskBack-End Related Task
Description
User Story:
As a developer, I want to refactor and reorganize the backend part of the project to follow to RESTful standards, ensuring a consistent and logical structure for the API endpoints.
Details:
Example of refactoring profiles endpoint:
-
Current endpoints:
urlpatterns = [ # GET /profiles/profile-picture # POST /profiles/profile-picture # PATCH /profiles/profile-picture # DELETE /profiles/profile-picture path("profile-picture", profile_views.ProfilePicturesView.as_view(), name="profile-picture"), # GET /profiles/biography/:account_id # POST /profiles/biography/:account_id path("biography/<int:account_id>", handler, name='biography'), # GET /profiles/profile-picture/:account_id path("profile-picture/<int:account_id>", handler, name="profile-picture-details"), # GET /profiles/user-name/:account_id # POST /profiles/user-name/:account_id path("user-name/<int:account_id>", handler, name="user-name"), # GET /profiles/preferred-name/:account_id # POST /profiles/preferred-name/:account_id path("preferred-name/<int:account_id>", handler, name="preferred-name"), # GET /profiles/preferred-pronouns/:account_id # POST /profiles/preferred-pronouns/:account_id path("preferred-pronouns/<int:account_id>", handler, name="preferred-pronouns"), ]
-
Proposed Structure:
urlpatterns = [ # GET /profiles/:account-id/profile-picture # POST /profiles/:account-id/profile-picture # PATCH /profiles/:account-id/profile-picture # DELETE /profiles/:account-id/profile-picture path('<int:account_id>/profile-picture/', handler, name="profile-picture"), # GET /profiles/:account-id # GET /profiles/:account-id?fields= # PATCH /profiles/:account-id path('<int:account_id>/', handler, name='profile-details'), ]
Technical details:
- Refactor/group the related endpoints to follow the proposed structure.
- Ensure that the backend API accepts requests with or without trailing slashes for all endpoints.
- Ensure thorough testing of all updated endpoints to confirm they work as expected.
Why do this?
This aims to improve the clarity, maintainability, and consistency of the API, making it easier for developers to understand and work with.
Metadata
Metadata
Assignees
Labels
Back-EndBack-End Related TaskBack-End Related Task
Type
Projects
Status
In Progress