mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 08:13:16 +00:00
Update SettingsController
This commit is contained in:
parent
fae385989e
commit
f1edf83af4
1 changed files with 19 additions and 2 deletions
|
@ -6,7 +6,7 @@ use App\AccountLog;
|
||||||
use App\Following;
|
use App\Following;
|
||||||
use App\Report;
|
use App\Report;
|
||||||
use App\UserFilter;
|
use App\UserFilter;
|
||||||
use Auth, DB, Cache, Purify;
|
use Auth, Cookie, DB, Cache, Purify;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Http\Controllers\Settings\{
|
use App\Http\Controllers\Settings\{
|
||||||
|
@ -176,7 +176,7 @@ class SettingsController extends Controller
|
||||||
$profile->save();
|
$profile->save();
|
||||||
Cache::forget('profiles:private');
|
Cache::forget('profiles:private');
|
||||||
Auth::logout();
|
Auth::logout();
|
||||||
DeleteAccountPipeline::dispatch($user);
|
DeleteAccountPipeline::dispatch($user)->onQueue('high');
|
||||||
return redirect('/');
|
return redirect('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,5 +192,22 @@ class SettingsController extends Controller
|
||||||
$reports = Report::whereProfileId($profile->id)->orderByDesc('created_at')->paginate(10);
|
$reports = Report::whereProfileId($profile->id)->orderByDesc('created_at')->paginate(10);
|
||||||
return view('settings.reports', compact('reports'));
|
return view('settings.reports', compact('reports'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function metroDarkMode(Request $request)
|
||||||
|
{
|
||||||
|
$this->validate($request, [
|
||||||
|
'mode' => 'required|string|in:light,dark'
|
||||||
|
]);
|
||||||
|
|
||||||
|
$mode = $request->input('mode');
|
||||||
|
|
||||||
|
if($mode == 'dark') {
|
||||||
|
$cookie = Cookie::make('dark-mode', true, 43800);
|
||||||
|
} else {
|
||||||
|
$cookie = Cookie::forget('dark-mode');
|
||||||
|
}
|
||||||
|
|
||||||
|
return response()->json([200])->cookie($cookie);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue