mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
improve error handling for document downloads
This commit is contained in:
parent
d64f18ef99
commit
e393b891bd
@ -52,8 +52,10 @@ class DocumentAPIController extends BaseAPIController
|
|||||||
{
|
{
|
||||||
$document = $request->entity();
|
$document = $request->entity();
|
||||||
|
|
||||||
return DocumentController::getDownloadResponse($document);
|
if(array_key_exists($document->type, Document::$types))
|
||||||
}
|
return DocumentController::getDownloadResponse($document);
|
||||||
|
else
|
||||||
|
return $this->errorResponse(['error'=>'Invalid mime type'],400); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param CreateDocumentRequest $request
|
* @param CreateDocumentRequest $request
|
||||||
|
Loading…
Reference in New Issue
Block a user