Skip to content

Commit 9635376

Browse files
committed
Move departments logic to enable redirect - addresses #455
1 parent af57094 commit 9635376

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

app/Http/Controllers/departmentsController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ public function index(): View
3737
public function details(string $slug): View|Response
3838
{
3939
$departments = Departments::find($slug);
40-
$staff = StaffProfiles::findByDepartment($departments['data'][0]['id']);
4140
if (empty($departments['data'])) {
4241
return response()->view('errors.404', [], 404);
42+
} else {
43+
$staff = StaffProfiles::findByDepartment($departments['data'][0]['id']);
4344
}
4445
return view('departments.details', compact('departments', 'staff'));
4546
}

config/missing-page-redirector.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -474,12 +474,12 @@
474474
# podcasts
475475
'/conversations/podcasts/episode' => '/conversations/podcasts/',
476476
# Department changes July 2022
477-
'/about-us/departments/antiquities' => '/about-us/departments/collections-and-research',
478-
'/about-us/departments/applied-arts' => '/about-us/departments/collections-and-research',
479-
'/about-us/departments/coins-and-medals' => '/about-us/departments/collections-and-research',
480-
'/about-us/departments/manuscripts-and-printed-books' => '/about-us/departments/collections-and-research',
481-
'/about-us/departments/paintings-drawings-and-prints' => '/about-us/departments/collections-and-research',
482-
'/about-us/departments/research' => '/about-us/departments/collections-and-research',
477+
'about-us/departments/antiquities' => '/about-us/departments/collections-and-research',
478+
'about-us/departments/applied-arts' => '/about-us/departments/collections-and-research',
479+
'about-us/departments/coins-and-medals' => '/about-us/departments/collections-and-research',
480+
'about-us/departments/manuscripts-and-printed-books' => '/about-us/departments/collections-and-research',
481+
'about-us/departments/paintings-drawings-and-prints' => '/about-us/departments/collections-and-research',
482+
'about-us/departments/research' => '/about-us/departments/collections-and-research',
483483
],
484484

485485
];

0 commit comments

Comments
 (0)