Skip to content

Commit

Permalink
Merge pull request #641 from plural/api-image
Browse files Browse the repository at this point in the history
Tidy up image formatting for the API.
  • Loading branch information
plural authored Jun 8, 2022
2 parents 9edd9a3 + 1348f47 commit 8ea1477
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/AppBundle/Controller/PublicApi20Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public function cardAction(string $card_code, Request $request)
{
return $this->getSingleEntityFromCache("public-api-card-" . $card_code, function() use ($card_code) {
return $this->entityManager->getRepository('AppBundle:Card')->findOneBy(['code' => $card_code]);
}, $request, ['imageUrlTemplate' => $this->getParameter('card_image_url') . 'large/{code}.jpg']);
}, $request, ['imageUrlTemplate' => rtrim($this->getParameter('card_image_url'), '/') . '/large/{code}.jpg']);
}

/**
Expand All @@ -385,7 +385,7 @@ public function cardsAction(Request $request)
{
return $this->getFromCache("public-api-cards", function() {
return $this->entityManager->getRepository('AppBundle:Card')->findAll();
}, $request, ['imageUrlTemplate' => $this->getParameter('card_image_url') . 'large/{code}.jpg']);
}, $request, ['imageUrlTemplate' => rtrim($this->getParameter('card_image_url'), '/') . '/large/{code}.jpg']);
}

/**
Expand Down

0 comments on commit 8ea1477

Please sign in to comment.