feat: allow users to set their age

Signed-off-by: miguel456 <me@nogueira.codes>
This commit is contained in:
2022-10-24 00:15:41 +01:00
parent ad4571db2a
commit 59351ef7bc
8 changed files with 173 additions and 0 deletions

View File

@@ -24,7 +24,9 @@ namespace App\Http\Controllers;
use App\Application;
use App\Exceptions\ApplicationNotFoundException;
use App\Exceptions\DiscordAccountRequiredException;
use App\Exceptions\IncompatibleAgeException;
use App\Exceptions\IncompleteApplicationException;
use App\Exceptions\InvalidAgeException;
use App\Exceptions\UnavailableApplicationException;
use App\Exceptions\VacancyNotFoundException;
use App\Facades\IP;
@@ -108,6 +110,15 @@ class ApplicationController extends Controller
request()->session()->put('discordApplicationRedirectedSlug', $vacancySlug);
return redirect(route('discordRedirect'));
} catch (IncompatibleAgeException $e) {
return redirect()
->to(route('dashboard'))
->with('error', $e->getMessage());
} catch (InvalidAgeException $e) {
return view('dashboard.application-rendering.add-age');
}
}