mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 04:14:04 +00:00
show current rate api
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Vendored
+4
-4
@@ -12,11 +12,11 @@ class ComposerStaticInit186bbd0d0f979469b3a193511536d69e
|
||||
'25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php',
|
||||
'667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
|
||||
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
|
||||
'2c102faa651ef8ea5874edb585946bce' => __DIR__ . '/..' . '/swiftmailer/swiftmailer/lib/swift_required.php',
|
||||
'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php',
|
||||
'2c102faa651ef8ea5874edb585946bce' => __DIR__ . '/..' . '/swiftmailer/swiftmailer/lib/swift_required.php',
|
||||
'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
|
||||
'5255c38a0faeba867671b61dfda6d864' => __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php',
|
||||
'37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
|
||||
'5255c38a0faeba867671b61dfda6d864' => __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php',
|
||||
'bd9634f2d41831496de0d3dfe4c94881' => __DIR__ . '/..' . '/symfony/polyfill-php56/bootstrap.php',
|
||||
'f0906e6318348a765ffb6eb24e0d0938' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/helpers.php',
|
||||
'58571171fd5812e6e447dce228f52f4d' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/helpers.php',
|
||||
@@ -145,8 +145,8 @@ class ComposerStaticInit186bbd0d0f979469b3a193511536d69e
|
||||
'phpDocumentor\\Reflection\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/phpdocumentor/reflection-common/src',
|
||||
1 => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src',
|
||||
2 => __DIR__ . '/..' . '/phpdocumentor/reflection-docblock/src',
|
||||
1 => __DIR__ . '/..' . '/phpdocumentor/reflection-docblock/src',
|
||||
2 => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src',
|
||||
),
|
||||
'Zizaco\\Entrust\\' =>
|
||||
array (
|
||||
|
||||
Reference in New Issue
Block a user