-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add include_beta_states flag to utilities endpoint #235
Conversation
The CI failure is the Node version thing, not an actual test failure... I'm looking into it |
Fixed in #236 |
utilities: getUtilitiesForLocation(location), | ||
utilities: getUtilitiesForLocation( | ||
location, | ||
request.query.include_beta_states ?? false, |
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.
Would this ever be null/undefined? I see that the default option is already set to false.
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.
(I see this present in many places where I'd expect there to always be a value, so perhaps I'm misunderstanding what default vals in the schema do in TS?)
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.
It's a little gap in the library we use to convert JSON Schema to TS types: ThomasAribart/json-schema-to-ts#153
## Description Now that we have a fallback to returning all of a state's utilities from `authorities.json` in the absence of state-specific logic in `utilities-for-location.ts`, we need a way to gate states. Makes sense to use the same logic as `/calculator`. ## Test Plan `yarn test`. Locally request utilities for CT zip code 06033 with and without the flag. Make sure results are the same for RI (02861) with and without the flag.
59dc164
to
bf9b8f5
Compare
Description
Now that we have a fallback to returning all of a state's utilities
from
authorities.json
in the absence of state-specific logic inutilities-for-location.ts
, we need a way to gate states. Makes senseto use the same logic as
/calculator
.Test Plan
yarn test
. Locally request utilities for CT zip code 06033 with andwithout the flag. Make sure results are the same for RI (02861) with
and without the flag.