potpie
potpie copied to clipboard
Inconsistent Status Codes for Resource Creation (201 vs. 200)
I noticed that in several places within the backend, we are returning 200 OK for resource creation instead of 201 Created. According to MDN documentation, 201 is the appropriate status code when a new resource is successfully created.
Steps to Reproduce:
Make a request to create a resource (e.g., POST /api/v1/conversations/).
Observe the response status code (should be 201 but sometimes returns 200).
Affected Endpoints:
POST `/api/v1/signup`
POST `/api/v1/parse`
POST `/api/v1/conversations/`,
POST `/api/v1/conversations/{conversation_id}/message/`,
maybe more but this is the scope of my Issue.
Expected Behavior:
When a resource is created, the API should return 201 Created instead of 200 OK.
Consistent usage of status codes across the project.
Proposed Fix:
Update all affected endpoints to return 201 Created when a resource is successfully created.
Review API responses for consistency.
Hi
@RudolfPleml are you a bot?
if not are you new to github ??
Yes i new
@RudolfPleml yeah, man, enjoy your coding journey. My name is Deepesh. Nice to be your acquaintance, man.