mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 12:24:09 +00:00
Merge branch 'nazri/show-current-rate-api' into 'master'
nazri/show current rate api See merge request CIEFWorldwideSdnBhd/exchange!47
This commit is contained in:
@@ -12,11 +12,6 @@ class RateController extends Controller
|
||||
return Rate::all();
|
||||
}
|
||||
|
||||
public function show(Rate $rate)
|
||||
{
|
||||
return $rate;
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$rate = Rate::create($request->all());
|
||||
@@ -37,4 +32,11 @@ class RateController extends Controller
|
||||
|
||||
return response()->json(null, 204);
|
||||
}
|
||||
|
||||
public function show()
|
||||
{
|
||||
$rate = DB::table('rates')->latest()->first();
|
||||
|
||||
return response()->json($rate, 200);
|
||||
}
|
||||
}
|
||||
+4
-3
@@ -69,8 +69,9 @@ Route::group(['middleware' => ['role:admin']], function() {
|
||||
Route::put('update-rate/{rate}', 'RateController@update');
|
||||
Route::delete('update-rate/{rate}', 'RateController@delete');
|
||||
Route::get('update-rate', 'RateController@index');
|
||||
Route::get('update-rate/{rate}', 'RateController@show');
|
||||
|
||||
|
||||
//show current rate
|
||||
Route::get('rate', 'RateController@show');
|
||||
|
||||
Route::get('setting-credit', 'SettingCreditController@index');
|
||||
Route::get('setting-credit/{credit}', 'SettingCreditController@show');
|
||||
@@ -106,7 +107,7 @@ Route::group(['middleware' => ['role:admin']], function() {
|
||||
Route::patch('/booking/{id}/update-china-bankslip','ChinaBankSlipController@update');
|
||||
Route::get('/booking/{id}/po', 'BookingController@showPurchaseOrder');
|
||||
Route::post('booking/{id}/upload-invoice', 'BookingController@uploadInvoice');
|
||||
Route::post('booking/{id}/confirm-invoice', 'BookingController@confirmInvoice');
|
||||
Route::post('booking/{id}/confirm-invoice', 'BookingController@confirmInvoice');
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -43,8 +43,8 @@ class RateTest extends TestCase
|
||||
'x2_ba' => '1.2'
|
||||
])
|
||||
->assertStatus(201);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function testUpdate(){
|
||||
$response =
|
||||
$this->actingAs($this->user)
|
||||
@@ -57,5 +57,12 @@ class RateTest extends TestCase
|
||||
'x2_ba' => '1.2'
|
||||
])
|
||||
->assertStatus(200);
|
||||
}
|
||||
|
||||
public function testShowRate(){
|
||||
$response = $this->json('GET', '/api/rate');
|
||||
$response
|
||||
->assertStatus(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user