actas controller update fix
This commit is contained in:
parent
e148efa2bc
commit
453a6f9276
@ -6,6 +6,7 @@
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Acta;
|
||||
|
||||
|
||||
class ActaController extends Controller
|
||||
{
|
||||
|
||||
@ -66,15 +67,16 @@ public function listActas()
|
||||
], 200);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
public function update(Request $request)
|
||||
{
|
||||
$request = Validator::make($request->all(), [
|
||||
'id' => 'required|exists:actas,id',
|
||||
'descripcion' => 'present',
|
||||
'fecha' => 'present',
|
||||
'id_estandar' => 'present|exists:estandars,id',
|
||||
]);
|
||||
|
||||
$acta = Acta::find($id);
|
||||
$acta = Acta::find($request->id);
|
||||
if (!$acta) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
|
@ -127,7 +127,7 @@
|
||||
//ruta Actas
|
||||
Route::post('acta', [ActaController::class, 'create']);
|
||||
Route::get('acta/{id}', [ActaController::class, 'showActa'])->where('id', '[0-9]+');
|
||||
Route::put('acta/{id}', [ActaController::class, 'update'])->where('id', '[0-9]+');
|
||||
Route::put('acta', [ActaController::class, 'update'])->where('id', '[0-9]+');
|
||||
Route::delete('acta/{id}', [ActaController::class, 'delete'])->where('id', '[0-9]+');
|
||||
Route::get('acta', [ActaController::class, 'listActas']);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user