mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
mark all notification as read
This commit is contained in:
@@ -159,6 +159,27 @@ class UserNotificationController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* mark all notification as read
|
||||
*
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function readAllNotification(Request $request)
|
||||
{
|
||||
if (!$request->isXmlHttpRequest()) {
|
||||
$this->app->abort(400);
|
||||
}
|
||||
|
||||
try {
|
||||
$this->getEventsManager()->readAll($this->getAuthenticatedUser()->getId());
|
||||
|
||||
return $this->app->json(['success' => true, 'message' => '']);
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
return $this->app->json(['success' => false, 'message' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all notifications
|
||||
|
Reference in New Issue
Block a user