From 7587e70dfaef054bbd29ed198c0622066a80df0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 9 Jan 2014 15:50:53 +0100 Subject: [PATCH] [add] API method to mark an entry as read --- app/controllers/api.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/controllers/api.php b/app/controllers/api.php index 3b6f714..6e02ea0 100644 --- a/app/controllers/api.php +++ b/app/controllers/api.php @@ -35,4 +35,12 @@ $api->get('/get', function (Request $request) use ($app) { return $app->json($entry, 201); }); +$api->get('/mark-read', function (Request $request) use ($app) { + $id = $request->request->get('id'); + + $entry = $app['entry_api']->markAsRead($id); + + return $app->json($entry, 201); +}); + return $api;