-
Notifications
You must be signed in to change notification settings - Fork 6
Built framework for processing different parameter types based on request method #124
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #124 +/- ##
==========================================
+ Coverage 97.85% 97.95% +0.10%
==========================================
Files 9 10 +1
Lines 140 147 +7
Branches 41 44 +3
==========================================
+ Hits 137 144 +7
Misses 3 3
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments above.
Can you describe how |
Co-authored-by: Wes Cossick <WesCossick@users.noreply.github.com>
const processParameters = (method: Parameters<typeof retrieveValidation>[0], parameters: RequestParameters): string => {
// Handle parameters for GET method
...
// Handle parameters for POST method
if (method === 'POST') {
// Build and return parameters object for the body here
}
...
}; That returned parameters object will be passed in the same way the search parameters are being passed in now for the |
In this merge request I prepared for having multiple parameter data types in resolving #115, to accomplish that i changed the way the URL was being built for
GET
requests to just be a static base for every kind of request, and append URL parameters if its aGET
request. In connection, I modifiedbuildRequestURL
to just return the search parameters as a string, instead of the whole URL. Lastly I made a new function,processParameters
that is meant to be the single source for logic dedicated to processing parameters for every kind of request.