mirror of
https://code.castopod.org/adaures/castopod
synced 2025-06-05 08:52:00 +00:00
fix(fediverse): update post controller namespace in routes
This commit is contained in:
parent
18fcb5ba3e
commit
3189f12206
@ -231,7 +231,7 @@ $routes->group('@(:podcastHandle)', static function ($routes): void {
|
|||||||
'controller-method' => 'PostController::index/$2',
|
'controller-method' => 'PostController::index/$2',
|
||||||
],
|
],
|
||||||
'application/ld+json; profile="https://www.w3.org/ns/activitystreams' => [
|
'application/ld+json; profile="https://www.w3.org/ns/activitystreams' => [
|
||||||
'namespace' => 'Modules/Fediverse/Controllers',
|
'namespace' => 'Modules\Fediverse\Controllers',
|
||||||
'controller-method' => 'PostController::index\$2',
|
'controller-method' => 'PostController::index\$2',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
@ -50,6 +50,10 @@ class PostController extends Controller
|
|||||||
|
|
||||||
public function _remap(string $method, string ...$params): mixed
|
public function _remap(string $method, string ...$params): mixed
|
||||||
{
|
{
|
||||||
|
if (count($params) === 0) {
|
||||||
|
throw PageNotFoundException::forPageNotFound();
|
||||||
|
}
|
||||||
|
|
||||||
if (! ($post = model('PostModel', false)->getPostById($params[0])) instanceof Post) {
|
if (! ($post = model('PostModel', false)->getPostById($params[0])) instanceof Post) {
|
||||||
throw PageNotFoundException::forPageNotFound();
|
throw PageNotFoundException::forPageNotFound();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user