Skip to content

Commit

Permalink
customcitation and map
Browse files Browse the repository at this point in the history
  • Loading branch information
nczirjak-acdh committed Aug 2, 2024
1 parent ced0208 commit d6d5bad
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Controller/ChildController.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function getChildData(string $id, array $searchProps, string $lang): Resp
$result = $helper->extractChildView($result, ['id', 'title', 'class', 'avDate'], $totalCount, $this->repoDb->getBaseUrl(), $lang);

if (count((array) $result) == 0) {
return new Response(json_encode("There is no resource"), 404, ['Content-Type' => 'application/json']);
return new Response(json_encode("There is no content"), 200, ['Content-Type' => 'application/json']);
}

$response = new Response();
Expand Down Expand Up @@ -142,15 +142,11 @@ public function getChildTreeData(string $id, array $searchProps, string $lang):
$result = $helper->extractChildTreeView($result, $totalCount, $this->repoDb->getBaseUrl(), $lang);

if (count((array) $result) == 0) {
return new Response(json_encode("There is no resource"), 404, ['Content-Type' => 'application/json']);
return new Response(json_encode("There is no content"), 200, ['Content-Type' => 'application/json']);
}

$response = new Response();
$response->setContent(
json_encode(
(array) $result
)
);
$response->setContent(json_encode((array) $result));
$response->headers->set('Content-Type', 'application/json');

return $response;
Expand Down

0 comments on commit d6d5bad

Please sign in to comment.