0

I'm using ember-model and doing this request App.Video.find({'sort':'createdAt+asc'}); in order to get sorted video list. So it must make this request

http://localhost:1337/api/v1/videos?sort=createdAt+asc

But instead it does this

http://localhost:1337/api/v1/videos?sort=createdAt%2Basc

and replace + with %2B. Do you have any ideas how to avoid ember doing this? Thank you!

Alex Berdyshev
  • 761
  • 2
  • 7
  • 21
  • Don't do that, you'll risk generating an invalid URL. Just unescape the parameters on the server side. – GJK Sep 07 '14 at 15:35

1 Answers1

1

Ember runs encodeURIComponent on the string 'createdAt+asc'.

Try doing App.Video.find({'sort':'createdAt asc'}); (note the space instead of the +) and seeing if that works for you.

tikotzky
  • 2,542
  • 1
  • 17
  • 20