Add API method to remove all feeds
This commit is contained in:
parent
51a746fac0
commit
e0bbaaa3b5
@ -37,6 +37,12 @@ $server->register('feed.delete', function($feed_id) {
|
|||||||
return Model\remove_feed($feed_id);
|
return Model\remove_feed($feed_id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Delete all feeds
|
||||||
|
$server->register('feed.delete_all', function() {
|
||||||
|
|
||||||
|
return Model\remove_feeds();
|
||||||
|
});
|
||||||
|
|
||||||
// Enable a feed
|
// Enable a feed
|
||||||
$server->register('feed.enable', function($feed_id) {
|
$server->register('feed.enable', function($feed_id) {
|
||||||
|
|
||||||
|
@ -390,6 +390,12 @@ function remove_feed($feed_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function remove_feeds()
|
||||||
|
{
|
||||||
|
return \PicoTools\singleton('db')->table('feeds')->remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function enable_feed($feed_id)
|
function enable_feed($feed_id)
|
||||||
{
|
{
|
||||||
return \PicoTools\singleton('db')->table('feeds')->eq('id', $feed_id)->save((array('enabled' => 1)));
|
return \PicoTools\singleton('db')->table('feeds')->eq('id', $feed_id)->save((array('enabled' => 1)));
|
||||||
|
Loading…
Reference in New Issue
Block a user