Move station index and admin index to root to avoid the single file in the folder.

This commit is contained in:
Buster Neece 2024-02-16 09:00:14 -06:00
parent 5af12f1327
commit fba050a463
No known key found for this signature in database
4 changed files with 10 additions and 12 deletions

View File

@ -2,7 +2,7 @@
declare(strict_types=1);
use App\Controller\Admin\IndexAction;
use App\Controller\AdminAction;
use App\Enums\GlobalPermissions;
use App\Middleware;
use Slim\Routing\RouteCollectorProxy;
@ -33,11 +33,11 @@ return static function (RouteCollectorProxy $app) {
];
foreach ($routes as $routeName => $routePath) {
$group->get($routePath, IndexAction::class)
$group->get($routePath, AdminAction::class)
->setName($routeName);
}
$group->get('/{routes:.+}', IndexAction::class);
$group->get('/{routes:.+}', AdminAction::class);
}
)->add(Middleware\Module\PanelLayout::class)
->add(Middleware\EnableView::class)

View File

@ -2,7 +2,7 @@
declare(strict_types=1);
use App\Controller\Stations\IndexAction;
use App\Controller\StationsAction;
use App\Enums\StationPermissions;
use App\Middleware;
use Slim\Routing\RouteCollectorProxy;
@ -41,11 +41,11 @@ return static function (RouteCollectorProxy $app) {
];
foreach ($routes as $routeName => $routePath) {
$group->get($routePath, IndexAction::class)
$group->get($routePath, StationsAction::class)
->setName($routeName);
}
$group->get('/{routes:.+}', IndexAction::class);
$group->get('/{routes:.+}', StationsAction::class);
}
)->add(Middleware\Module\PanelLayout::class)
->add(new Middleware\Permissions(StationPermissions::View, true))

View File

@ -2,14 +2,13 @@
declare(strict_types=1);
namespace App\Controller\Admin;
namespace App\Controller;
use App\Controller\SingleActionInterface;
use App\Http\Response;
use App\Http\ServerRequest;
use Psr\Http\Message\ResponseInterface;
final class IndexAction implements SingleActionInterface
final class AdminAction implements SingleActionInterface
{
public function __invoke(
ServerRequest $request,

View File

@ -2,17 +2,16 @@
declare(strict_types=1);
namespace App\Controller\Stations;
namespace App\Controller;
use App\Container\EntityManagerAwareTrait;
use App\Container\SettingsAwareTrait;
use App\Controller\SingleActionInterface;
use App\Enums\StationFeatures;
use App\Http\Response;
use App\Http\ServerRequest;
use Psr\Http\Message\ResponseInterface;
final class IndexAction implements SingleActionInterface
final class StationsAction implements SingleActionInterface
{
use EntityManagerAwareTrait;
use SettingsAwareTrait;