Skip to content

feat: standardize API response structure across backend and update frontend handling#36

Open
A69SHUBHAM wants to merge 1 commit into
chaoss:mainfrom
A69SHUBHAM:feature/api-response-standardization
Open

feat: standardize API response structure across backend and update frontend handling#36
A69SHUBHAM wants to merge 1 commit into
chaoss:mainfrom
A69SHUBHAM:feature/api-response-standardization

Conversation

@A69SHUBHAM
Copy link
Copy Markdown

Summary

This PR introduces a consistent API response structure across all backend endpoints and updates the frontend to handle the new format.

Changes

  • Standardized API responses using a unified format
  • Introduced helper functions:
    • success_response(message, data)
    • error_response(message, error)
  • Refactored all endpoints to use the new structure
  • Ensured consistent HTTP status codes for success and error cases
  • Updated frontend to correctly parse and display responses

Why this is needed

Previously, API responses were inconsistent across endpoints, making frontend handling complex and error-prone. This change improves predictability and maintainability.

Testing

  • Verified all endpoints return consistent response format
  • Tested success and error scenarios
  • Confirmed frontend correctly handles new structure

Impact

  • Improves code consistency and readability
  • Simplifies frontend logic
  • Enhances maintainability and debugging

Closes #35

Signed-off-by: A69SHUBHAM <spacekrai0@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent API response structure across backend endpoints

1 participant