In the Search Module I would like to know if it is possible to add parameters to the search query before making the ajax call.
For example, I have right now the url is given like this :
apiSettings: {
url: '/dashboard/verbatims/autocomplete/tag?q={query}'
},
but the problem is I need to add another paramter "topic" to that url, but I cannot hardcode it because the topic parameter might change, so I need to append the currently set value before making the search.
Is it possible to have a "beforeQuery" hook ?
For example:
searchObj.search({
apiSettings: {
url: '/dashboard/verbatims/autocomplete/tag?q={query}',
beforeQuery: function(queryobj){
// adding topic parameter to query object
queryobj.topic = getCurrentTopic()
// then continuing the make the ajax call
return queryobj
}
},
Check out our API docs
Hi, thanks for posting, unfortunately although your question is valid, this is a usage question, and not appropriate for posting on GitHub Issues.
To help make this board manageable for maintainers to effectively work on actionable changes to the library, we've limited posts on this board to specific bug reports or feature requests. To see how we differentiate between the two, please check out our Contributing Guide.
To help get answers to your question (or get feedback that might allow you to repost this issue) you might want to check out one of our other support resources.
Ok understood. I was going to post of StackOverflow, but I thought it would be more relevant if I ask the question to the source.