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

Code Cleanup

This commit is contained in:
David Bomba 2023-11-03 09:26:46 +11:00
parent da1fde0976
commit 20a74f199c

View File

@ -55,6 +55,9 @@ class ImportJsonController extends BaseController
*/
public function import(ImportJsonRequest $request)
{
/** @var \App\Models\User $user */
$user = auth()->user();
$file_location = $request->file('files')
->storeAs(
'migrations',
@ -63,9 +66,9 @@ class ImportJsonController extends BaseController
);
if (Ninja::isHosted()) {
CompanyImport::dispatch(auth()->user()->getCompany(), auth()->user(), $file_location, $request->except('files'))->onQueue('migration');
CompanyImport::dispatch($user->company(), $user, $file_location, $request->except('files'))->onQueue('migration');
} else {
CompanyImport::dispatch(auth()->user()->getCompany(), auth()->user(), $file_location, $request->except('files'));
CompanyImport::dispatch($user->company(), $user, $file_location, $request->except('files'));
}
return response()->json(['message' => 'Processing'], 200);