diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-09-13 18:29:34 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-09-13 18:29:34 +0200 |
commit | 6b138b98a6a92d31263dfcf8075e432f0df40649 (patch) | |
tree | 8f647ec1491de674f3093f24fad21521d25eec01 /external/newsapi.php | |
parent | e178dc843a677fe2512ebd2247e20016eb18cd5b (diff) |
use before and after update hooks to delete items only after new ones have been fetched
Diffstat (limited to 'external/newsapi.php')
-rw-r--r-- | external/newsapi.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/external/newsapi.php b/external/newsapi.php index 1121f3400..51a2d9cf2 100644 --- a/external/newsapi.php +++ b/external/newsapi.php @@ -64,8 +64,19 @@ class NewsAPI extends Controller { * @Ajax * @API */ - public function cleanUp() { - $this->updater->cleanUp(); + public function beforeUpdate() { + $this->updater->beforeUpdate(); + return new JSONResponse(); + } + + + /** + * @CSRFExemption + * @Ajax + * @API + */ + public function afterUpdate() { + $this->updater->afterUpdate(); return new JSONResponse(); } |