Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

[WIP] Refactoring Search API to accept query parameters through a map. #83

Closed
wants to merge 5 commits into from

Conversation

dhruvsinghal
Copy link

@pengwynn Here's the barebones modification to the search API, just to check if I'm on the right track.

@@ -5,44 +5,44 @@ import (
"net/url"
)

var SearchURL = Hyperlink("search{/type}?q={query}{&page,per_page,sort,order}")
var SearchURL = Hyperlink("search{/type}?q={query}&page={page}&per_page={per_page}&sort={sort}&order={order}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need to change these. That's the correct format for URI template params like this. The expansion will handle the ? and & automatically.

@dhruvsinghal
Copy link
Author

Please take a look. Note that only the user search has been implemented.

@dhruvsinghal
Copy link
Author

@pengwynn Please take a look. I've refactored the code as we discussed.

)

var SearchURL = Hyperlink("search{/type}?q={query}{&page,per_page,sort,order}")
var SearchURITemplate = "search{/type}?q={query}{&page,per_page,sort,order}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I like keeping this a Hyperlink for convenience.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants