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

Code cleaning and refactoring - Phase 1 #260

Closed
VisargD opened this issue Mar 18, 2024 · 0 comments · Fixed by #259
Closed

Code cleaning and refactoring - Phase 1 #260

VisargD opened this issue Mar 18, 2024 · 0 comments · Fixed by #259
Assignees
Labels
enhancement New feature or request triage

Comments

@VisargD
Copy link
Collaborator

VisargD commented Mar 18, 2024

As a part of phase 1, the following changes can be done to clean up the code so that redundant code can be replaced by single functions and to make provider addition easier:

  • Standardize all the provider API configs to have same functions: headers, getBaseURL and getEndpoint.
  • Remove all the provider specific if/else-if blocks from tryPost and tryPostProxy by making use of the above mentioned standardized functions.
  • Create error response builder function and reuse it for all the providers to keep control in one place instead of having it in all providers separately.
  • Create a VALID_PROVIDERS array which can be used in requestValidator middleware instead of import all the providers names separately
@VisargD VisargD added the enhancement New feature or request label Mar 18, 2024
@VisargD VisargD self-assigned this Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant