mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Improvements for live preview
This commit is contained in:
parent
e4fc9e2cc8
commit
e17af36cf4
@ -61,11 +61,11 @@ class PreviewController extends BaseController
|
||||
}
|
||||
|
||||
private function purgeCache()
|
||||
{ nlog(auth()->user()->id);
|
||||
{
|
||||
Cache::pull("preview_".auth()->user()->id);
|
||||
}
|
||||
|
||||
public function newLivePreview(PreviewInvoiceRequest $request)
|
||||
public function live(PreviewInvoiceRequest $request)
|
||||
{
|
||||
|
||||
$time = time();
|
||||
@ -153,8 +153,6 @@ class PreviewController extends BaseController
|
||||
|
||||
$pdf = (new PreviewPdf($maker->getCompiledHTML(true), $company))->handle();
|
||||
|
||||
nlog("merpy derp {$time}");
|
||||
|
||||
return response()->streamDownload(function () use ($pdf) {
|
||||
echo $pdf;
|
||||
}, 'preview.pdf', ['Content-Type' => 'application/pdf','Cache-Control:' => 'no-cache']);
|
||||
@ -273,7 +271,7 @@ class PreviewController extends BaseController
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function live(PreviewInvoiceRequest $request)
|
||||
public function livex(PreviewInvoiceRequest $request)
|
||||
{
|
||||
|
||||
// if(Cache::has("preview_".auth()->user()->id))
|
||||
|
@ -92,10 +92,10 @@ class PreviewInvoiceRequest extends Request
|
||||
return $this->stubInvitation();
|
||||
|
||||
match($this->entity){
|
||||
'invoice' => $invitation = Invoice::withTrashed()->where('invoice_id', $this->entity_id)->first(),
|
||||
'quote' => $invitation = Quote::withTrashed()->where('quote_id', $this->entity_id)->first(),
|
||||
'credit' => $invitation = Credit::withTrashed()->where('credit_id', $this->entity_id)->first(),
|
||||
'recurring_invoice' => $invitation = RecurringInvoice::withTrashed()->where('recurring_invoice_id', $this->entity_id)->first(),
|
||||
'invoice' => $invitation = InvoiceInvitation::withTrashed()->where('invoice_id', $this->entity_id)->first(),
|
||||
'quote' => $invitation = QuoteInvitation::withTrashed()->where('quote_id', $this->entity_id)->first(),
|
||||
'credit' => $invitation = CreditInvitation::withTrashed()->where('credit_id', $this->entity_id)->first(),
|
||||
'recurring_invoice' => $invitation = RecurringInvoiceInvitation::withTrashed()->where('recurring_invoice_id', $this->entity_id)->first(),
|
||||
};
|
||||
|
||||
if($invitation)
|
||||
|
Loading…
x
Reference in New Issue
Block a user