-
Notifications
You must be signed in to change notification settings - Fork 1
Search bar & requests to server
Francesco Moro edited this page Mar 21, 2016
·
2 revisions
The search button should make a request to the server. The request url will contain two key value pairs:
- q: the query string in the search bar input field (uri encoded)
- categories: the categories that have been selected (clicked) from the dropdown menu
- If no category has been selected, search for "beauty makeup":
/search?q=beauty%20makeup&categories=
- Categories Health and Sports selected, search "vitamin supplements":
/search?q=vitamin%20%supplements&categories=Health,Sports
The server will handle the request and call the database based on the url parameters, by calling the dbHelpers "getSearchResults" method, passing:
- a categories array
- a string of keywords
- a callback on the results (an array of objects)