Reputation: 33
I'm creating a search page on my website, that is powered by GetCandy's API. Part of the criteria is to have a sort by dropdown filter for changing sorts.
I can see the API returns an array of sort data like this:
[
{ name: 'desc' },
]
Does that mean it can return multiple sorts?
If so, I am wondering how to pass multiple sorts back to the API in a request.
I know I can make a request with { sort: 'name-desc' }
to give me a single sort. What do I need to do to concatenate sorts?
Upvotes: 1
Views: 69
Reputation: 33
You are able to pass multiple sort criteria by concatenating them with the |
pipe.
E.G.:
{
sort: 'name-desc|price'
}
Upvotes: 1