improve error handling for document downloads
This commit is contained in:
parent
d64f18ef99
commit
e393b891bd
1 changed files with 4 additions and 2 deletions
|
|
@ -52,8 +52,10 @@ class DocumentAPIController extends BaseAPIController
|
|||
{
|
||||
$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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue