handle nullable pdf params
This commit is contained in:
parent
9126b0e968
commit
8c8ee4c050
3 changed files with 18 additions and 4 deletions
|
|
@ -69,8 +69,8 @@ class ElementController
|
|||
}
|
||||
|
||||
public function showPdf(
|
||||
string $folder,
|
||||
string $fileName,
|
||||
?string $folder,
|
||||
?string $fileName,
|
||||
): Response|JsonResponse {
|
||||
try {
|
||||
$result = $this->getElementPdf->execute(
|
||||
|
|
@ -79,6 +79,10 @@ class ElementController
|
|||
fileName: $fileName,
|
||||
)
|
||||
);
|
||||
} catch (BadRequestException $exception) {
|
||||
return new JsonResponse([
|
||||
'error' => $exception->getMessage(),
|
||||
], 400);
|
||||
} catch (NotFoundException $exception) {
|
||||
return new JsonResponse([
|
||||
'error' => $exception->getMessage(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue