mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 03:54:35 -04:00
Code Cleanup
This commit is contained in:
parent
da1fde0976
commit
20a74f199c
@ -55,6 +55,9 @@ class ImportJsonController extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function import(ImportJsonRequest $request)
|
public function import(ImportJsonRequest $request)
|
||||||
{
|
{
|
||||||
|
/** @var \App\Models\User $user */
|
||||||
|
$user = auth()->user();
|
||||||
|
|
||||||
$file_location = $request->file('files')
|
$file_location = $request->file('files')
|
||||||
->storeAs(
|
->storeAs(
|
||||||
'migrations',
|
'migrations',
|
||||||
@ -63,9 +66,9 @@ class ImportJsonController extends BaseController
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (Ninja::isHosted()) {
|
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 {
|
} 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);
|
return response()->json(['message' => 'Processing'], 200);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user