Added the support for generating docs from template doc
This commit is contained in:
@@ -24,3 +24,16 @@
|
||||
// Import entities and suggestions
|
||||
Route::get('/import-entities', [\App\Http\Controllers\ImportEntityController::class, 'index'])->name('api.importEntities.index');
|
||||
Route::post('/import-entities/suggest', [\App\Http\Controllers\ImportEntityController::class, 'suggest'])->name('api.importEntities.suggest');
|
||||
|
||||
// Actions with decisions for document template settings UI
|
||||
Route::get('/actions-with-decisions', function () {
|
||||
$actions = \App\Models\Action::with(['decisions:id,name'])->orderBy('name')->get(['id', 'name']);
|
||||
|
||||
return [
|
||||
'actions' => $actions->map(fn ($a) => [
|
||||
'id' => $a->id,
|
||||
'name' => $a->name,
|
||||
'decisions' => $a->decisions->map(fn ($d) => ['id' => $d->id, 'name' => $d->name])->values(),
|
||||
]),
|
||||
];
|
||||
})->middleware('auth:sanctum');
|
||||
|
||||
Reference in New Issue
Block a user