fix(fediverse): update post controller namespace in routes

This commit is contained in:
Yassine Doghri 2023-09-15 16:40:07 +00:00
parent 18fcb5ba3e
commit 3189f12206
2 changed files with 5 additions and 1 deletions

View File

@ -231,7 +231,7 @@ $routes->group('@(:podcastHandle)', static function ($routes): void {
'controller-method' => 'PostController::index/$2',
],
'application/ld+json; profile="https://www.w3.org/ns/activitystreams' => [
'namespace' => 'Modules/Fediverse/Controllers',
'namespace' => 'Modules\Fediverse\Controllers',
'controller-method' => 'PostController::index\$2',
],
],

View File

@ -50,6 +50,10 @@ class PostController extends Controller
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) {
throw PageNotFoundException::forPageNotFound();
}