mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Improve error when downloading deleted invoice
This commit is contained in:
parent
f573e09349
commit
9e437e8a12
@ -584,6 +584,10 @@ class ClientPortalController extends BaseController
|
||||
|
||||
private function returnError($error = false)
|
||||
{
|
||||
if (request()->phantomjs) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
return response()->view('error', [
|
||||
'error' => $error ?: trans('texts.invoice_not_found'),
|
||||
'hideHeader' => true,
|
||||
|
@ -423,7 +423,12 @@ class InvoiceApiController extends BaseAPIController
|
||||
public function download(InvoiceRequest $request)
|
||||
{
|
||||
$invoice = $request->entity();
|
||||
$pdfString = $invoice->getPDFString();
|
||||
|
||||
return $this->fileReponse($invoice->getFileName(), $invoice->getPDFString());
|
||||
if ($pdfString) {
|
||||
return $this->fileReponse($invoice->getFileName(), $pdfString);
|
||||
} else {
|
||||
abort(404);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user