diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-01-22 01:10:31 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-22 01:10:31 -0800 |
commit | 0efbfcbe61e26cb53cb0719ced3c5c436f128386 (patch) | |
tree | b2ecb3e855de9426e37db6496fc6cc96bb83a9c8 /modules/gallery/helpers/item_rest.php | |
parent | a445a64bcbfc5df45f255e02d3295156e199832d (diff) |
Return the url of the newly created item from post().
Don't try to access ORM::$changed -- it's protected.
Diffstat (limited to 'modules/gallery/helpers/item_rest.php')
-rw-r--r-- | modules/gallery/helpers/item_rest.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/gallery/helpers/item_rest.php b/modules/gallery/helpers/item_rest.php index edc44c45..9598b191 100644 --- a/modules/gallery/helpers/item_rest.php +++ b/modules/gallery/helpers/item_rest.php @@ -98,9 +98,7 @@ class item_rest_Core { $item->$key = $request->params->$key; } } - if ($item->changed) { - $item->save(); - } + $item->save(); } static function post($request) { @@ -135,6 +133,8 @@ class item_rest_Core { default: throw new Rest_Exception("Invalid type: $params->type", 400); } + + return array("url" => rest::url("item", $item)); } static function delete($request) { |