summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorDavide Saurino <davide.saurino@alcacoop.it>2014-03-12 23:57:55 +0100
committerDavide Saurino <davide.saurino@alcacoop.it>2014-03-12 23:57:55 +0100
commitc179198a0408f6d3edf27d5e3f8ab006da32bf0c (patch)
tree77cbd86fc45d818b7555763cee17e47140b1de65 /api
parent37181c603b2aaa4dbd0d17ecf4927f28523c2ad8 (diff)
Add feed renaming to the API (FIX #455)
Diffstat (limited to 'api')
-rw-r--r--api/feedapi.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/api/feedapi.php b/api/feedapi.php
index 4ad9b3307..0880434d8 100644
--- a/api/feedapi.php
+++ b/api/feedapi.php
@@ -183,6 +183,28 @@ class FeedAPI extends Controller {
/**
+ * @IsAdminExemption
+ * @IsSubAdminExemption
+ * @CSRFExemption
+ * @Ajax
+ * @API
+ */
+ public function rename() {
+ $userId = $this->api->getUserId();
+ $feedId = (int) $this->params('feedId');
+ $feedTitle = $this->params('feedTitle');
+
+ try {
+ $this->feedBusinessLayer->rename($feedId, $feedTitle, $userId);
+ return new JSONResponse();
+ } catch(BusinessLayerException $ex) {
+ return new JSONResponse(array('message' => $ex->getMessage()),
+ Http::STATUS_NOT_FOUND);
+ }
+ }
+
+
+ /**
* @CSRFExemption
* @Ajax
* @API