summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-01-22 01:10:31 -0800
committerBharat Mediratta <bharat@menalto.com>2010-01-22 01:10:31 -0800
commit0efbfcbe61e26cb53cb0719ced3c5c436f128386 (patch)
treeb2ecb3e855de9426e37db6496fc6cc96bb83a9c8
parenta445a64bcbfc5df45f255e02d3295156e199832d (diff)
Return the url of the newly created item from post().
Don't try to access ORM::$changed -- it's protected.
-rw-r--r--modules/gallery/helpers/item_rest.php6
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) {