wire user texts routes and update seed
open POST /api/texts and node create endpoints to any
authenticated user; expose new /texts and /texts/{id} pages
plus admin-only GET /api/texts/all. ViewController gains
userTexts and userText methods. seed gives Tanach to the
regular user and adds a second non-admin user.
This commit is contained in:
parent
acdf703d80
commit
051e44033f
3 changed files with 38 additions and 7 deletions
|
|
@ -29,20 +29,28 @@ $app->post('/api/auth/register', [AuthController::class, 'register']);
|
|||
$app->group('', function (RouteCollectorProxy $group) {
|
||||
$group->get('/home', [ViewController::class, 'home']);
|
||||
$group->get('/today', [ViewController::class, 'today']);
|
||||
$group->get('/texts', [ViewController::class, 'userTexts']);
|
||||
$group->get('/texts/{textId}', [ViewController::class, 'userText']);
|
||||
|
||||
$group->post('/api/auth/logout', [AuthController::class, 'logout']);
|
||||
$group->get('/api/auth/me', [AuthController::class, 'me']);
|
||||
|
||||
$group->get('/api/texts', [TextController::class, 'getTexts']);
|
||||
$group->get('/api/texts', [TextController::class, 'getMyTexts']);
|
||||
$group->get(
|
||||
'/api/texts/{textId}',
|
||||
[TextController::class, 'getText']
|
||||
);
|
||||
$group->post('/api/texts', [TextController::class, 'createText']);
|
||||
|
||||
$group->get(
|
||||
'/api/nodes/{textId}',
|
||||
[NodeController::class, 'getNodesOfText']
|
||||
);
|
||||
$group->post('/api/nodes', [NodeController::class, 'createNode']);
|
||||
$group->post(
|
||||
'/api/nodes/bulk',
|
||||
[NodeController::class, 'bulkCreateNodes']
|
||||
);
|
||||
|
||||
$group->post('/api/plans', [PlanController::class, 'createPlan']);
|
||||
|
||||
|
|
@ -61,12 +69,7 @@ $app->group('', function (RouteCollectorProxy $group) {
|
|||
[ViewController::class, 'text']
|
||||
);
|
||||
|
||||
$group->post('/api/texts', [TextController::class, 'createText']);
|
||||
$group->post(
|
||||
'/api/nodes/bulk',
|
||||
[NodeController::class, 'bulkCreateNodes']
|
||||
);
|
||||
$group->post('/api/nodes', [NodeController::class, 'createNode']);
|
||||
$group->get('/api/texts/all', [TextController::class, 'getAllTexts']);
|
||||
})->add(AdminMiddleware::class)->add(AuthMiddleware::class);
|
||||
|
||||
return $app;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue