mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim-api.git
synced 2026-08-19 04:24:01 +00:00
contact approval and testing
This commit is contained in:
@@ -125,4 +125,39 @@ class ContactController extends Controller
|
||||
|
||||
return response()->json($contact, 204);
|
||||
}
|
||||
|
||||
public function postApprove(Request $request, $id)
|
||||
{
|
||||
$contact = Contact::where('id', '=', e($id))->first();
|
||||
if($contact)
|
||||
{
|
||||
|
||||
$action=$request->input('action');
|
||||
if ($action==1)
|
||||
{
|
||||
$contact->status=1;
|
||||
}
|
||||
if ($action==0)
|
||||
{
|
||||
$contact->status=0;
|
||||
}
|
||||
else{
|
||||
return response()->json(["message" => "not allowed"], 400);
|
||||
}
|
||||
|
||||
$saved = $contact->save();
|
||||
if ($saved){
|
||||
return response()->json($contact, 201);
|
||||
}
|
||||
return response()->json($contact, 400);
|
||||
|
||||
// $contact = $request->input('id');
|
||||
// $contact->status = 1;
|
||||
// $contact->save();
|
||||
//return redirect()->back()->with('info','Request has been approved ');
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user