ajax commands: Remove need for decoding json
commit3c96c647302e507a7ebb10813512a3cff82704b3
authorRobin Sonefors <robin.sonefors@op5.com>
Wed, 30 Apr 2014 09:27:28 +0000 (30 11:27 +0200)
committerRobin Sonefors <robin.sonefors@op5.com>
Wed, 30 Apr 2014 11:54:32 +0000 (30 13:54 +0200)
treecfcf4bacda7faf8de81524569fb9963ce6109aef
parent3800c9743139f14c926ba75afb28997ccab8e04a
ajax commands: Remove need for decoding json

Our json::ok() helper sets the correct HTTP header to make jquery
auto-decode the json for us.

In addition, return json::ok() makes it clearer that we won't end up in
more than one of the old echo json_encode() clauses.

Change-Id: Iab1e422ec797436f2a8df7f40b8373f230971725
Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
application/controllers/ajax.php
application/media/js/ajax.commands.js