Skip to content

Commit

Permalink
Eformidling: justering for henting av meldinger
Browse files Browse the repository at this point in the history
  • Loading branch information
EirikWulff committed Sep 10, 2024
1 parent 8bf4bf9 commit 037be19
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Services/Eformidling.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ public function getIncomingMessages() : Collection|false {
$last = false;
while ($last == false):
$response = $this->apiQuery($uri, $params, true);
if ($response->successful()):
if ($response->successful() && $response->json('totalElements') > 0):
//dd($response->body());
$result = $response->json('content');
$contents = $response->json('content');
$params['page']++;
$last = $response->json('last');
// Legger til resultatene
foreach ($result as $msg):
foreach ($contents as $msg):
$messages->push($msg);
endforeach;
endif;
Expand Down

0 comments on commit 037be19

Please sign in to comment.