Skip to content

Commit

Permalink
change Auth::user to request->user
Browse files Browse the repository at this point in the history
  • Loading branch information
AmonDeShir committed Aug 8, 2024
1 parent f35a51d commit 6d08b6a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/Http/Controllers/OrganizationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use App\Http\Resources\OrganizationResource;
use App\Jobs\FetchRepositoriesJob;
use App\Models\Organization;
use App\Models\User;
use App\Services\AssignUserToOrganizationsService;
use Carbon\Carbon;
use Illuminate\Bus\Batch;
Expand Down Expand Up @@ -38,7 +39,7 @@ public function show(Request $request)
return Inertia::render("Organization", ["data" => $data, "progress" => $status]);
}

public function fetchData(int $organizationId): JsonResponse
public function fetchData(int $organizationId, Request $request): JsonResponse
{
$organization = Organization::query()->findOrFail($organizationId);
$batch = $this->findBatch($organizationId);
Expand All @@ -47,7 +48,8 @@ public function fetchData(int $organizationId): JsonResponse
return response()->json(["message" => "please wait"], Response::HTTP_CONFLICT);
}

$jobs = [new FetchRepositoriesJob($organizationId, Auth::user()->id)];
$user = $request->user();
$jobs = [new FetchRepositoriesJob($organizationId, $user->id)];

$organization->fetch_at = Carbon::now();
$organization->save();
Expand Down

0 comments on commit 6d08b6a

Please sign in to comment.