diff --git a/extend.php b/extend.php index 8ec76e9..012f9e6 100644 --- a/extend.php +++ b/extend.php @@ -15,7 +15,8 @@ return [ (new Flarum\Locales(__DIR__ . '/resources/locale')), (new Flarum\Routes('api')) - ->get('/blomstra/search/{type}', 'blomstra.search', Api\Controllers\SearchController::class), + ->get('/blomstra/search/{type}', 'blomstra.search', Api\Controllers\SearchController::class) + ->put('/blomstra/search/index', 'blomstra.search.index', Api\Controllers\IndexController::class), (new Flarum\Console) ->command(Commands\BuildCommand::class) diff --git a/src/Api/Controllers/IndexController.php b/src/Api/Controllers/IndexController.php new file mode 100644 index 0000000..573ce8c --- /dev/null +++ b/src/Api/Controllers/IndexController.php @@ -0,0 +1,30 @@ +getAttribute('actor'); + $actor->assertAdmin(); + + /** @var BuildCommand $command */ + $command = resolve(BuildCommand::class); + + $command->run( + new ArrayInput([]), + new ConsoleOutput); + + return new EmptyResponse(); + } +}