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 Application's General Logic #19

Merged
merged 5 commits into from
Jun 26, 2024
Merged

Conversation

dhruv-ahuja
Copy link
Owner

This PR addresses certain issues and modifies application logic to better assist API development.

Includes:

  • Correct signatures for exception handlers to match FastAPI's requirements
  • Improve data serialization function used by APIs to cache or fetch cached data
  • Correct User schema type issues and reduce unnecessary code
  • Refactor core user fetching service function to have better separation of concerns

- use Exception and Response base classes to match signature
- cast exceptions into required types insde function definition
- get error messages through exception error codes
- update name to better reflect function's purpose
- add support for response value when data is already available
- update docstring to reflect above change
- add logger statements
- correctly parse mongodb id when validating for user response
- use projection for get users API and clean up code
- include serialize function name changes for user router
@dhruv-ahuja dhruv-ahuja merged commit dd4850c into main Jun 26, 2024
1 of 2 checks passed
@dhruv-ahuja dhruv-ahuja deleted the refactor/app_config branch June 26, 2024 18:17
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.

1 participant