Allow item_rest::put() to replace the current data file. Remove

data_rest::put() altogether; it's no longer necessary.
This commit is contained in:
Bharat Mediratta
2010-08-08 01:12:43 -07:00
parent 7f61f9754e
commit 4e95ec843a
2 changed files with 6 additions and 12 deletions

View File

@@ -58,18 +58,6 @@ class data_rest_Core {
return $result;
}
static function put($request) {
$item = rest::resolve($request->url);
access::required("edit", $item);
if ($item->is_album()) {
throw new Rest_Exception("Bad Request", 400, array("errors" => array("type" => "invalid")));
}
$item->set_data_file($request->file);
$item->save();
}
static function resolve($id) {
$item = ORM::factory("item", $id);
if (!access::can("view", $item)) {