Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request ConductionNL#1288 from ConductionNL/hotfix/logservice
Browse files Browse the repository at this point in the history
Hotfix logservice
  • Loading branch information
rjzondervan authored Jan 26, 2023
2 parents 454b45c + e71a0fe commit b37d4bd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions api/src/Service/LogService.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,15 @@ public function saveLog(Request $request, Response $response = null, int $stopWa
*/
private function removeUnreads(Log $callLog)
{
if ($callLog->getResponseStatusCode() === 200 && !empty($callLog->getEndpoint())
if (
$callLog->getResponseStatusCode() === 200 &&
!empty($callLog->getEndpoint())
&& $callLog->getUserId() !== null && !empty($callLog->getObjectId()) &&
strtolower($callLog->getRequestMethod()) === 'get' &&
(strtolower($callLog->getEndpoint()->getMethod()) === 'get') ||
in_array('get', array_map('strtolower', $callLog->getEndpoint()->getMethods()))) {
(
strtolower($callLog->getEndpoint()->getMethod()) === 'get' ||
in_array('get', array_map('strtolower', $callLog->getEndpoint()->getMethods()))
)) {
// Check if there exist Unread objects for this Object+User. If so, delete them.
$object = $this->entityManager->getRepository('App:ObjectEntity')->find($callLog->getObjectId());
if ($object instanceof ObjectEntity) {
Expand Down

0 comments on commit b37d4bd

Please sign in to comment.