diff --git a/app/Http/Controllers/Import/Instagram.php b/app/Http/Controllers/Import/Instagram.php index 401a6be38..eef51f919 100644 --- a/app/Http/Controllers/Import/Instagram.php +++ b/app/Http/Controllers/Import/Instagram.php @@ -11,6 +11,7 @@ use App\{ Profile, User }; +use App\Jobs\ImportPipeline\ImportInstagram; trait Instagram { @@ -134,8 +135,6 @@ trait Instagram $job->stage = 3; $job->save(); return redirect($job->url()); - return $json; - } public function instagramStepThree(Request $request, $uuid) @@ -148,4 +147,19 @@ trait Instagram ->firstOrFail(); return view('settings.import.instagram.step-three', compact('profile', 'job')); } + + public function instagramStepThreeStore(Request $request, $uuid) + { + $profile = Auth::user()->profile; + + $job = ImportJob::whereProfileId($profile->id) + ->whereNull('completed_at') + ->whereUuid($uuid) + ->whereStage(3) + ->firstOrFail(); + + ImportInstagram::dispatchNow($job); + + return redirect($profile->url()); + } }