fix default project of admin (#419)

This commit is contained in:
Saeed Vaziry 2025-01-05 03:40:17 -08:00 committed by GitHub
parent 20c6b58866
commit a320e52dbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,9 +18,11 @@ public function handle(Request $request, Closure $next)
if (! $user->currentProject) { if (! $user->currentProject) {
if ($user->allProjects()->count() > 0) { if ($user->allProjects()->count() > 0) {
$user->current_project_id = $user->projects->first()->id; $user->current_project_id = $user->allProjects()->first()->id;
$user->save(); $user->save();
$request->user()->refresh();
return $next($request); return $next($request);
} }