mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 20:34:08 +00:00
added unit testing
This commit is contained in:
@@ -69,19 +69,25 @@ class BookingController extends Controller
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $booking)
|
||||
public function update(Request $request, $book_id)
|
||||
{
|
||||
// $booking->update($request->all());
|
||||
// $this->validate($request, [
|
||||
// 'account_name' => 'required',
|
||||
// 'account_num' => 'required'
|
||||
// ]);
|
||||
//Update Post
|
||||
$booking = Booking::find($booking);
|
||||
// $booking->account_name = 'hello';
|
||||
// $booking->account_num = 'account_num';
|
||||
$booking->save();
|
||||
return response()->json($booking, 200);
|
||||
$book_id = Booking::find($book_id);
|
||||
|
||||
//$com_id->id = $request->input('id');
|
||||
$book_id->account_name = $request->input('account_name');
|
||||
$book_id->account_num = $request->input('account_num');
|
||||
$book_id->bank_name = $request->input('bank_name');
|
||||
$book_id->bank_branch = $request->input('bank_branch');
|
||||
$book_id->company_name = $request->input('company_name');
|
||||
$book_id->company_address = $request->input('company_address');
|
||||
$book_id->bank_address = $request->input('bank_address');
|
||||
$book_id->swift_code = $request->input('swift_code');
|
||||
$book_id->cnap = $request->input('cnap');
|
||||
$book_id->save();
|
||||
|
||||
return response()->json(['book_id'=>$book_id],200);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,10 +96,10 @@ class BookingController extends Controller
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function delete(Booking $booking)
|
||||
public function delete(Booking $book_id)
|
||||
{
|
||||
$booking->delete($booking);
|
||||
$book_id->delete($book_id);
|
||||
|
||||
return response()->json($booking, 204);
|
||||
return response()->json($book_id, 204);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user