Skip to content

Commit

Permalink
Return a 404 rather than a 500 if the oetition id is not valid.
Browse files Browse the repository at this point in the history
  • Loading branch information
judgej committed Feb 15, 2019
1 parent 0d2a2db commit 8df425e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/ReportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class ReportController extends Controller
{
public function simpleOverview(int $petitionNumber = null)
public function simpleOverview($petitionNumber = null)
{
if ($petitionNumber !== null) {
$petition = Petition::where('petition_number', '=', $petitionNumber)
Expand Down
8 changes: 5 additions & 3 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
|
*/

Route::redirect('/', '/overview');
Route::middleware('throttle:30,1')->group(function () {
// There is just the one page for now.

// ReportController
Route::redirect('/', '/overview');

// ReportController

Route::middleware('throttle:30,1')->group(function () {
Route::get('/overview/{petitionNumber?}', 'ReportController@simpleOverview')
->name('overview');
});

0 comments on commit 8df425e

Please sign in to comment.