|
|
|
@ -65,11 +65,16 @@ class ProjectController extends Controller
|
|
|
|
|
return response()->json(['status'=>'success','message'=>'Data added!', 'data_result' =>$dataResultInsert, 'code'=> 200], 200); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function edit($id){ |
|
|
|
|
if(empty($id) || !is_int((int)$id)) |
|
|
|
|
return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); |
|
|
|
|
public function edit($id) |
|
|
|
|
{ |
|
|
|
|
if (empty($id) || !is_int((int)$id)) |
|
|
|
|
return response()->json(['status' => 'failed', 'message' => 'id is required!', 'code' => 400], 400); |
|
|
|
|
|
|
|
|
|
$result = Project::query() |
|
|
|
|
->select(array_diff(DB::getSchemaBuilder()->getColumnListing('m_proyek'), ['created_by', 'created_at', 'updated_at', 'updated_by', 'scurve'])) |
|
|
|
|
->whereId($id) |
|
|
|
|
->first(); |
|
|
|
|
|
|
|
|
|
$result = Project::find($id); |
|
|
|
|
|
|
|
|
|
if(!$result) |
|
|
|
|
return response()->json(['status'=>'failed','message'=> 'Data not found!','code'=> 404], 404); |
|
|
|
|