Fixed bad /api docs redirection on sub path

Direct route redirect does not seem to go via standard URL generator so
misses off generation via base URL.
This commit is contained in:
Dan Brown 2023-05-29 14:41:59 +01:00
parent e3c4a9d167
commit f78c0635ee
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 9 additions and 1 deletions

View File

@ -28,4 +28,12 @@ class ApiDocsController extends ApiController
return response()->json($docs);
}
/**
* Redirect to the API docs page.
*/
public function redirect()
{
return redirect('/api/docs');
}
}

View File

@ -29,7 +29,7 @@ Route::middleware('auth')->group(function () {
->where('path', '.*$');
// API docs routes
Route::redirect('/api', '/api/docs');
Route::get('/api', [ApiDocsController::class, 'redirect']);
Route::get('/api/docs', [ApiDocsController::class, 'display']);
Route::get('/pages/recently-updated', [EntityControllers\PageController::class, 'showRecentlyUpdated']);