But Twitter Typeahead (Search autocomplete function) wants:
[
{id: 1, title: 'a'},
{id: 2, title: 'b'}
...
]
Currently api/v1/search follows Typeahead's formatting, and the ember route #/search uses ajax, and raw json objects instead of wrapping them as Ember objects.
Either
Get typeahead to accept embre style json
Get ember to accept typeahead style json for the #/search route only
Have the server respond with the correct format depending on if the request comes from ember or typeahead.
One is prefered over Two. Three is probably the best. Typeahead doesn't need the podcast's full description so sending cut down json saves some bandwidth. Sending a boolean typeahead parameter seems a touch hacky though.
Ember expects json in the format
But Twitter Typeahead (Search autocomplete function) wants:
Currently
api/v1/search
follows Typeahead's formatting, and the ember route#/search
uses ajax, and raw json objects instead of wrapping them as Ember objects.Either
#/search
route onlyOne is prefered over Two. Three is probably the best. Typeahead doesn't need the podcast's full description so sending cut down json saves some bandwidth. Sending a boolean
typeahead
parameter seems a touch hacky though.