Commit 3b838e37 authored by Laura Heimann's avatar Laura Heimann

fixed notification clear bug

parent e29d3f92
...@@ -60,7 +60,7 @@ class APIConnectNotificationsController extends AbstractController ...@@ -60,7 +60,7 @@ class APIConnectNotificationsController extends AbstractController
$connectToken = $request->query->get('connectToken'); $connectToken = $request->query->get('connectToken');
$notificationIDToClear = $request->query->get('notificationID'); $notificationIDToClear = $request->query->get('notificationID');
if($connectToken == "" || $notificationIDToClear = "") { if($connectToken == "" || $notificationIDToClear == "") {
$response = new JsonResponse(['version' => $this->getParameter('api_version'), 'status' => 403, 'data' => []]); $response = new JsonResponse(['version' => $this->getParameter('api_version'), 'status' => 403, 'data' => []]);
return $response; return $response;
} }
...@@ -68,7 +68,7 @@ class APIConnectNotificationsController extends AbstractController ...@@ -68,7 +68,7 @@ class APIConnectNotificationsController extends AbstractController
$connection = $em->getRepository(Connection::class)->findOneBy(array('connectToken' => $connectToken)); $connection = $em->getRepository(Connection::class)->findOneBy(array('connectToken' => $connectToken));
if($connection) { if($connection) {
$notificationToClear = $em->getRepository(UserNotification::class)->findOneBy(array('id' => $notificationIDToClear, 'user' => $connection->getUser())); $notificationToClear = $em->getRepository(UserNotification::class)->findOneBy(array('id' => intval($notificationIDToClear), 'user' => $connection->getUser()));
if($notificationToClear) { if($notificationToClear) {
$em->remove($notificationToClear); $em->remove($notificationToClear);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment