mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04: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)
|
private function returnError($error = false)
|
||||||
{
|
{
|
||||||
|
if (request()->phantomjs) {
|
||||||
|
abort(404);
|
||||||
|
}
|
||||||
|
|
||||||
return response()->view('error', [
|
return response()->view('error', [
|
||||||
'error' => $error ?: trans('texts.invoice_not_found'),
|
'error' => $error ?: trans('texts.invoice_not_found'),
|
||||||
'hideHeader' => true,
|
'hideHeader' => true,
|
||||||
|
@ -423,7 +423,12 @@ class InvoiceApiController extends BaseAPIController
|
|||||||
public function download(InvoiceRequest $request)
|
public function download(InvoiceRequest $request)
|
||||||
{
|
{
|
||||||
$invoice = $request->entity();
|
$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…
x
Reference in New Issue
Block a user