Correcion causas de plan

master
cgonzalesmo 2022-08-16 22:20:04 -05:00
parent c3026c4fdd
commit 881783bd4f
1 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ class CausasRaicesController extends Controller
$id_user = auth()->user()->id; $id_user = auth()->user()->id;
if(plan::where(["id"=>$request->id_plan])->exists()){ if(plan::where(["id"=>$request->id_plan])->exists()){
$plan = plan::find($request->id_plan); $plan = plan::find($request->id_plan);
if($plan->id_user == $id_user){ if($plan->id_user == $id_user){
$causa = new CausasRaices(); $causa = new CausasRaices();
$causa->id_plan = $request->id_plan; $causa->id_plan = $request->id_plan;
$causa->descripcion = $request->descripcion; $causa->descripcion = $request->descripcion;
@ -50,8 +50,8 @@ class CausasRaicesController extends Controller
$id_user = auth()->user()->id; $id_user = auth()->user()->id;
if(CausasRaices::where(["id"=>$request->id])->exists()){ if(CausasRaices::where(["id"=>$request->id])->exists()){
$causa = CausasRaices::find($request->id); $causa = CausasRaices::find($request->id);
$plan = plan::find($meta->id_plan); $plan = plan::find($causa->id_plan);
if($plan->id_user == $id_user){ if($plan->id_user == $id_user){
$causa->descripcion = $request->descripcion; $causa->descripcion = $request->descripcion;
$causa->save(); $causa->save();
return response([ return response([