1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

Working on handling refresh route

This commit is contained in:
David Bomba 2020-07-26 08:27:49 +10:00
parent 8b9104e9f1
commit 34575554af
3 changed files with 35 additions and 6 deletions

View File

@ -132,8 +132,35 @@ class BaseController extends Controller
protected function refreshResponse($query) protected function refreshResponse($query)
{ {
$includes = [
'company.tax_rates',
'company.groups',
'company.company_gateways.gateway',
'company.clients.contacts',
'company.products',
'company.invoices.invitations.contact',
'company.invoices.invitations.company',
'company.invoices.documents',
'company.payments.paymentables',
'company.quotes.invitations.contact',
'company.quotes.invitations.company',
'company.quotes.documents',
'company.credits.invitations.contact',
'company.credits.invitations.company',
'company.credits.documents',
'company.payment_terms.company',
'company.credits.invitations.contact',
'company.credits.invitations.company',
'company.vendors.contacts',
'company.expenses',
'company.tasks',
'company.projects',
'company.designs',
'company.webhooks',
'company.tokens_hashed'
];
// $this->manager->parseIncludes($includes); $this->manager->parseIncludes($includes);
$this->serializer = request()->input('serializer') ?: EntityTransformer::API_SERIALIZER_ARRAY; $this->serializer = request()->input('serializer') ?: EntityTransformer::API_SERIALIZER_ARRAY;
@ -151,7 +178,7 @@ class BaseController extends Controller
$query->with( $query->with(
[ [
'company' => function ($query) use($updated_at){ 'company' => function ($query) use($updated_at){
$query->whereNotNull('updated_at'); $query->where('updated_at', '>=', date('Y-m-d H:i:s', 0));
}, },
'company.clients'=>function ($query) use($updated_at){ 'company.clients'=>function ($query) use($updated_at){
$query->where('clients.updated_at', '>=', $updated_at)->with('contacts'); $query->where('clients.updated_at', '>=', $updated_at)->with('contacts');
@ -422,6 +449,8 @@ class BaseController extends Controller
$data['report_errors'] = true; $data['report_errors'] = true;
} }
$data['hash'] = md5(public_path('main.dart.js'));
return view('index.index', $data); return view('index.index', $data);
} }

View File

@ -51,7 +51,7 @@ class QueryLogging
Log::info($request->method() . ' - ' . $request->url() . ": $count queries - " . $time); Log::info($request->method() . ' - ' . $request->url() . ": $count queries - " . $time);
// if($count > 700) // if($count > 700)
// Log::info($queries); // Log::info($queries);
} }
} }

View File

@ -5,7 +5,7 @@
<title>Invoice Ninja</title> <title>Invoice Ninja</title>
<meta name="report_errors" content="{{ $report_errors }}"> <meta name="report_errors" content="{{ $report_errors }}">
<meta name="google-signin-client_id" content="{{ config('services.google.client_id') }}"> <meta name="google-signin-client_id" content="{{ config('services.google.client_id') }}">
<link rel="manifest" href="manifest.json?v={{ md5(public_path('manifest.json')) }}"> <link rel="manifest" href="manifest.json?v={{ $hash }}">
</head> </head>
<body style="background-color:#888888;"> <body style="background-color:#888888;">
@ -75,7 +75,7 @@
<script> <script>
if ('serviceWorker' in navigator) { if ('serviceWorker' in navigator) {
window.addEventListener('load', function () { window.addEventListener('load', function () {
navigator.serviceWorker.register('/flutter_service_worker.js?v={{ md5(public_path('flutter_service_worker.js')) }}'); navigator.serviceWorker.register('/flutter_service_worker.js?v={{ $hash }}');
}); });
} }
@ -84,7 +84,7 @@
}); });
</script> </script>
<script defer src="main.dart.js?v={{ md5(public_path('main.dart.js')) }}" type="application/javascript"></script> <script defer src="main.dart.js?v={{ $hash }}" type="application/javascript"></script>
<center style="padding-top: 150px" id="loader"> <center style="padding-top: 150px" id="loader">
<div class="loader"></div> <div class="loader"></div>