Skip to content

Commit

Permalink
feature: correct order for responses
Browse files Browse the repository at this point in the history
closes #5
  • Loading branch information
g105b committed Jan 12, 2024
1 parent 546bd82 commit ea8dedd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion class/Response/ResponseRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function getAll(?RequestEntity $requestEntity):array {
);
}

return array_reverse($responseArray);
return $responseArray;
}

public function deleteAll(RequestEntity $requestEntity):void {
Expand Down
9 changes: 7 additions & 2 deletions page/_component/response-viewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ function go(
):void {
$binder->bindList($responseRepository->getAll($requestEntity));

if($firstResponseDetails = $element->querySelector("ul>li>details")) {
$firstResponseDetails->open = true;
$lastResponseDetailsEl = null;
foreach($element->querySelectorAll("ul>li>details") as $responseDetailsEl) {
$lastResponseDetailsEl = $responseDetailsEl;
}

if($lastResponseDetailsEl) {
$lastResponseDetailsEl->open = true;
}
}

Expand Down

0 comments on commit ea8dedd

Please sign in to comment.