From 44f22ab8b4c46befab98440f69a05725928bed75 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 24 Sep 2016 17:36:33 +0200 Subject: API move feed to another category https://github.com/jangernert/FeedReader/issues/59 https://github.com/FreshRSS/FreshRSS/issues/443 --- app/Controllers/feedController.php | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'app/Controllers/feedController.php') 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 . '` ' . -- cgit v1.2.3