From b8b4dfb4969e1baf84a14fb65a5dc153b0f5fae4 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Thu, 9 May 2013 12:57:35 +0200 Subject: only make one request for mark all read and mark folder read, fix #171, fix a bug that prevented readding of feeds when its folder was deleted, fix a bug that would not allow mark read for feeds when the app was started for the first time --- appinfo/api.php | 15 +++++++++++++++ appinfo/routes.php | 14 +++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) (limited to 'appinfo') diff --git a/appinfo/api.php b/appinfo/api.php index 2c9c7b24b..a2adcf373 100644 --- a/appinfo/api.php +++ b/appinfo/api.php @@ -75,6 +75,13 @@ use \OCA\AppFramework\External\External; \OC_API::USER_AUTH ); +\OCP\API::register('put', '/apps/news/folders/{folderId}/read', + function($params) { + return External::main('FolderAPI', 'read', $params, new DIContainer()); + }, + 'news', + \OC_API::USER_AUTH +); /** * Feed API @@ -168,4 +175,12 @@ use \OCA\AppFramework\External\External; }, 'news', \OC_API::USER_AUTH +); + +\OCP\API::register('put', '/apps/news/items/read', + function($params) { + return External::main('ItemAPI', 'readAll', $params, new DIContainer()); + }, + 'news', + \OC_API::USER_AUTH ); \ No newline at end of file diff --git a/appinfo/routes.php b/appinfo/routes.php index 1acf11334..28a6cadff 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -77,6 +77,12 @@ $this->create('news_folders_rename', '/folders/{folderId}/rename')->post()->acti } ); +$this->create('news_folders_read', '/folders/{folderId}/read')->post()->action( + function($params){ + App::main('FolderController', 'read', $params, new DIContainer()); + } +); + /** * Feeds */ @@ -118,7 +124,7 @@ $this->create('news_feeds_move', '/feeds/{feedId}/move')->post()->action( $this->create('news_feeds_read', '/feeds/{feedId}/read')->post()->action( function($params){ - App::main('ItemController', 'readFeed', $params, new DIContainer()); + App::main('FeedController', 'read', $params, new DIContainer()); } ); @@ -163,6 +169,12 @@ $this->create('news_items_unstar', '/items/{feedId}/{guidHash}/unstar')->post()- } ); +$this->create('news_items_all_read', '/items/read')->post()->action( + function($params){ + App::main('ItemController', 'readAll', $params, new DIContainer()); + } +); + /** * Export */ -- cgit v1.2.3