Ultima Narrativa
This commit is contained in:
parent
f3fdb42751
commit
2e66fc4309
@ -100,4 +100,15 @@ public function listNarrativas()
|
||||
"data" => $narrativas,
|
||||
]);
|
||||
}
|
||||
public function ultimaNarrativa(Request $request){
|
||||
$request->validate([
|
||||
"id_estandar" => 'required|exists:App\Models\Estandar,id',
|
||||
]);
|
||||
$narrativa = Narrativa::where("id_estandar", $request->id_estandar)->latest()->first();
|
||||
return response([
|
||||
"status" => 1,
|
||||
"message" => "!Ultima Narrativa del estandar ".$request->id_estandar,
|
||||
"data" => $narrativa,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@
|
||||
Route::get('user-profile', [UserController::class, 'userProfile']);
|
||||
Route::put('update', [UserController::class, 'updateRoleEstado']);
|
||||
Route::post('register', [UserController::class, 'register']);
|
||||
Route::get('user', [UserController::class, 'listUser']);
|
||||
Route::get('user', [UserController::class, 'listUser']);
|
||||
Route::get('enabled_users', [UserController::class, 'listUserHabilitados']);
|
||||
|
||||
|
||||
@ -120,6 +120,7 @@
|
||||
Route::put('narrativa', [NarrativasController::class, 'update']);
|
||||
Route::delete('narrativa/{id}', [NarrativasController::class, 'delete'])->where('id', '[0-9]+');
|
||||
Route::get('narrativa', [NarrativasController::class, 'listNarrativas']);
|
||||
Route::get('narrativa/ultima/{id}', [NarrativasController::class, 'ultimaNarrativa']->where('id', '[0-9]+'));
|
||||
});
|
||||
|
||||
/*Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
|
||||
|
Loading…
Reference in New Issue
Block a user