Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor TestUserRoutes Status Codes and Refactor API Response Structures into Separate Module #29

Merged
merged 5 commits into from
Apr 14, 2024

Conversation

doziestar
Copy link
Contributor

This PR addresses the need to make our codebase more maintainable by extracting response structures from the routes.py and placing them in a new, dedicated responses.py file and also addresses the issue of hardcoded status codes in the TestUserRoutes class. This change not only enhances readability but also ensures that we're leveraging FastAPI's built-in utilities for more maintainable and self-explanatory code.

Key Changes:

  1. Introduced responses.py to house centralized response structures.
  2. Updated endpoints in routes.py to utilize the response structures from the new module.
  3. Enhanced overall readability of the routes.py by reducing inline content.

This change centralizes the management of API responses and streamlines any potential future modifications.
@asacristani
Copy link
Owner

Great work!
With this structure, the services are more clear reducing the code in router.
Please, can you run the pre-commit hooks? It is not passing the pipeline (if not, I will run it later).

Thanks!

@asacristani asacristani self-requested a review October 15, 2023 17:44
@asacristani asacristani added the improvement Something better done label Oct 15, 2023
@doziestar
Copy link
Contributor Author

image

resolved

@asacristani
Copy link
Owner

Good job @doziestar
Thanks!

@asacristani asacristani merged commit aca03fd into asacristani:main Apr 14, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Something better done
Projects
Development

Successfully merging this pull request may close these issues.

2 participants