summaryrefslogtreecommitdiffstats
path: root/controller
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2015-11-01 15:16:15 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2015-11-01 15:16:15 +0100
commita42da9a97c7fc84af09e01f3d6f3ee80a46b763b (patch)
treecf4b58d55c0f4e46db3dbea1bd3bd93f155d107c /controller
parentcc5dd4231b11f87a7b0d0e66a7d00e62d11f7fb9 (diff)
clean up feed api
Diffstat (limited to 'controller')
-rw-r--r--controller/feedapicontroller.php4
-rw-r--r--controller/feedcontroller.php45
2 files changed, 10 insertions, 39 deletions
diff --git a/controller/feedapicontroller.php b/controller/feedapicontroller.php
index 0d9e985f7..d6198bc2c 100644
--- a/controller/feedapicontroller.php
+++ b/controller/feedapicontroller.php
@@ -152,7 +152,7 @@ class FeedApiController extends ApiController {
*/
public function move($feedId, $folderId) {
try {
- $this->feedService->move($feedId, $folderId, $this->userId);
+ $this->feedService->patch($feedId, $this->userId, ['folderId' => $folderId]);
} catch(ServiceNotFoundException $ex) {
return $this->error($ex, Http::STATUS_NOT_FOUND);
}
@@ -172,7 +172,7 @@ class FeedApiController extends ApiController {
*/
public function rename($feedId, $feedTitle) {
try {
- $this->feedService->rename($feedId, $feedTitle, $this->userId);
+ $this->feedService->patch($feedId, $this->userId, ['title' => $feedTitle]);
} catch(ServiceNotFoundException $ex) {
return $this->error($ex, Http::STATUS_NOT_FOUND);
}
diff --git a/controller/feedcontroller.php b/controller/feedcontroller.php
index 8fa9504f4..0b6948a15 100644
--- a/controller/feedcontroller.php
+++ b/controller/feedcontroller.php
@@ -203,41 +203,6 @@ class FeedController extends Controller {
/**
* @NoAdminRequired
*
- * @param int $feedId
- * @param int $parentFolderId
- * @return array|\OCP\AppFramework\Http\JSONResponse
- */
- public function move($feedId, $parentFolderId){
- try {
- $this->feedService->move($feedId, $parentFolderId, $this->userId);
- } catch(ServiceNotFoundException $ex) {
- return $this->error($ex, Http::STATUS_NOT_FOUND);
- }
-
- return [];
- }
-
- /**
- * @NoAdminRequired
- *
- * @param int $feedId
- * @param string $feedTitle
- * @return array|\OCP\AppFramework\Http\JSONResponse
- */
- public function rename($feedId, $feedTitle) {
- try {
- $this->feedService->rename($feedId, $feedTitle, $this->userId);
- } catch(ServiceNotFoundException $ex) {
- return $this->error($ex, Http::STATUS_NOT_FOUND);
- }
-
- return [];
- }
-
-
- /**
- * @NoAdminRequired
- *
* @param array $json
* @return array
*/
@@ -301,13 +266,19 @@ class FeedController extends Controller {
* @param bool $fullTextEnabled
* @param int $updateMode
* @param int $ordering
+ * @param int $folderId
+ * @param string $title
*/
- public function patch($feedId, $pinned=null, $fullTextEnabled=null, $updateMode=null, $ordering=null) {
+ public function patch($feedId, $pinned=null, $fullTextEnabled=null,
+ $updateMode=null, $ordering=null, $title=null,
+ $folderId=null) {
$attributes = [
'pinned' => $pinned,
'fullTextEnabled' => $fullTextEnabled,
'updateMode' => $updateMode,
- 'ordering' => $ordering
+ 'ordering' => $ordering,
+ 'title' => $title,
+ 'folderId' => $folderId
];
$diff = array_filter($attributes, function ($value) {