mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim-api.git
synced 2026-08-19 04:24:01 +00:00
fixed database issue
This commit is contained in:
@@ -24,18 +24,6 @@ class ContactController extends Controller
|
||||
return response()->json($contact, 200);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
@@ -67,51 +55,6 @@ class ContactController extends Controller
|
||||
return response()->json($contact, 201);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
// $contact = Contact::find($id);
|
||||
// if (!$contact)
|
||||
// {
|
||||
// return response()->json(['message'=>'ID not found'],200);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// $contact->ff_id=$request->input('ff_id');
|
||||
//
|
||||
//
|
||||
// $contact->save();
|
||||
// return response()->json(['contact'=>$contact],200);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
@@ -120,7 +63,8 @@ class ContactController extends Controller
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$contact=Contact::find($id);
|
||||
$contact = Contact::where("user_id", Auth::user()->id)->where('id', $id)->first();
|
||||
//$contact=Contact::find($id);
|
||||
$contact->delete();
|
||||
|
||||
return response()->json($contact, 204);
|
||||
|
||||
Reference in New Issue
Block a user