-
Notifications
You must be signed in to change notification settings - Fork 1
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
Cast API query parameter string booleans to real booleans #391
Labels
Comments
liammulh
added a commit
that referenced
this issue
May 5, 2023
liammulh
added a commit
that referenced
this issue
May 24, 2023
As of a9a31d6, I believe this is done awaiting deploy. |
This is deployed. |
Reopening because there is a TODO marked for this issue. |
liammulh
added a commit
that referenced
this issue
May 27, 2023
liammulh
changed the title
refactor: cast API query parameter string booleans to real booleans
Cast API query parameter string booleans to real booleans
May 27, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some of the API routes expect query parameters to be present. For example, see the function associated with the
simNamesAndTitles
API route:rosetta/src/server/translationApi/api/simNamesAndTitles.js
Lines 19 to 22 in b1e931d
The
req.query.isTeamMember
is returned as a string. We should cast it (and other API query parameter string booleans) to a real boolean so that it doesn't trip anyone up in the future. This will also involve changing the parameters to the functions we call using the API query parameter string booleans.To do this comprehensively, we should search across the project for instances of
req.query.*
. We should note where these variables are being used, cast them to booleans in the API callback functions, and modify the functions that use these variable so that they expect booleans rather than string booleans.The text was updated successfully, but these errors were encountered: