aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/feedController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-09-24 17:36:33 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-09-24 17:36:33 +0200
commit44f22ab8b4c46befab98440f69a05725928bed75 (patch)
tree71a9c76629514af82bf5706a1c64c850e7d305c2 /app/Controllers/feedController.php
parentd9bf9b2c6f0b2cc9dec3b638841b7e3040dcf46f (diff)
API move feed to another category
https://github.com/jangernert/FeedReader/issues/59 https://github.com/FreshRSS/FreshRSS/issues/443
Diffstat (limited to 'app/Controllers/feedController.php')
-rwxr-xr-xapp/Controllers/feedController.php14
1 files changed, 1 insertions, 13 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index ffda1450d..c64b67a80 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -511,21 +511,9 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
$feed_id = Minz_Request::param('f_id');
$cat_id = Minz_Request::param('c_id');
-
- if ($cat_id === false) {
- // If category was not given get the default one.
- $catDAO = new FreshRSS_CategoryDAO();
- $catDAO->checkDefault();
- $def_cat = $catDAO->getDefault();
- $cat_id = $def_cat->id();
- }
-
$feedDAO = FreshRSS_Factory::createFeedDao();
- $values = array('category' => $cat_id);
- $feed = $feedDAO->searchById($feed_id);
- if ($feed && ($feed->category() == $cat_id ||
- $feedDAO->updateFeed($feed_id, $values))) {
+ if ($feedDAO->moveFeed($feed_id, $cat_id)) {
// TODO: return something useful
} else {
Minz_Log::warning('Cannot move feed `' . $feed_id . '` ' .