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

feat!: use enum constraints for source type input #58

Merged
merged 4 commits into from
Aug 28, 2024
Merged

Conversation

jsstevenson
Copy link
Contributor

  • Constrain input types so it's clearer up front what is legal input
  • Fix issue with the POTENTIALLY_DRUGGABLE type (legal input was producing invalid query)

@jsstevenson jsstevenson added the priority:low Low priority label Aug 28, 2024
mcannon068nw
mcannon068nw previously approved these changes Aug 28, 2024
Copy link
Contributor

@mcannon068nw mcannon068nw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just an error pointing users to SourceType, otherwise LGTM

api_url = api_url if api_url else API_ENDPOINT_URL
client = _get_client(api_url)
params = {} if search.lower() == "all" else {"sourceType": search}
params = {} if source_type is None else {"sourceType": source_type.value.upper()}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe have an explicit error pointing user to the SourceTypes here?

@jsstevenson jsstevenson merged commit 43daf59 into main Aug 28, 2024
12 checks passed
@jsstevenson jsstevenson deleted the fix-source-type branch August 28, 2024 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:low Low priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants