Skip to content

Enable API search with checkbox on the UI. #1444

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

Merged
merged 1 commit into from
Jul 12, 2018

Conversation

isoos
Copy link
Collaborator

@isoos isoos commented Jul 12, 2018

@isoos isoos requested a review from sortie July 12, 2018 09:39
Copy link

@sortie sortie left a comment

Choose a reason for hiding this comment

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

lgtm

I second Michael in assuming api=1 if api is unset, and only adding api=0 to the query parameter if the checkbox is unmarked.

@@ -372,13 +372,16 @@ SearchQuery _parseSearchQuery(shelf.Request request, String platform) {
final SearchOrder sortOrder = (sortParam == null || sortParam.isEmpty)
? null
: parseSearchOrder(sortParam);

final apiParam = request.requestedUri.queryParameters['api'];
final isApiEnabled = apiParam == 'on' || apiParam == '1';
Copy link

Choose a reason for hiding this comment

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

Why both? Why not just 1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The first version was based on the html checkbox inside the form, and that was sending 'on', and I expected that a future refactor could move the checkbox inside. However, the reversed logic (api=0) would make that option infeasible, it won't be a concern anymore.

@isoos isoos force-pushed the search_checkbox branch 3 times, most recently from 90f2fae to 4684616 Compare July 12, 2018 11:02
@isoos isoos merged commit 117eca0 into dart-lang:master Jul 12, 2018
@isoos isoos deleted the search_checkbox branch July 12, 2018 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants