diff --git a/jsonrpc.php b/jsonrpc.php index 73532fe..d600481 100644 --- a/jsonrpc.php +++ b/jsonrpc.php @@ -37,6 +37,12 @@ $server->register('feed.delete', function($feed_id) { return Model\remove_feed($feed_id); }); +// Delete all feeds +$server->register('feed.delete_all', function() { + + return Model\remove_feeds(); +}); + // Enable a feed $server->register('feed.enable', function($feed_id) { diff --git a/model.php b/model.php index 63ef4e8..c238757 100644 --- a/model.php +++ b/model.php @@ -390,6 +390,12 @@ function remove_feed($feed_id) } +function remove_feeds() +{ + return \PicoTools\singleton('db')->table('feeds')->remove(); +} + + function enable_feed($feed_id) { return \PicoTools\singleton('db')->table('feeds')->eq('id', $feed_id)->save((array('enabled' => 1)));