1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 22:22:32 +01:00

Minor fixes for document downloads

This commit is contained in:
David Bomba 2021-07-02 07:57:55 +10:00
parent c120dedaa5
commit 5bcbda2f47
2 changed files with 3 additions and 2 deletions

View File

@ -32,9 +32,9 @@ class SetDocumentDb
'errors' => new stdClass,
];
if ($request->has('document_hash') && config('ninja.db.multi_db_enabled')) {
if (config('ninja.db.multi_db_enabled')) {
if (! MultiDB::documentFindAndSetDb($request->input('document_hash')))
if (! MultiDB::documentFindAndSetDb($request->segment(2)))
return response()->json($error, 400);
}

View File

@ -15,6 +15,7 @@ use App\Models\Client;
use App\Models\ClientContact;
use App\Models\Company;
use App\Models\CompanyToken;
use App\Models\Document;
use App\Models\User;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;