From 0efbfcbe61e26cb53cb0719ced3c5c436f128386 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 22 Jan 2010 01:10:31 -0800 Subject: Return the url of the newly created item from post(). Don't try to access ORM::$changed -- it's protected. --- modules/gallery/helpers/item_rest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules') 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) { -- cgit v1.2.3