Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/exchange into feature/supplier-report

This commit is contained in:
Jack Goh
2018-07-01 20:50:27 +08:00
3 changed files with 20 additions and 10 deletions
+7 -5
View File
@@ -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
View File
@@ -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');
});
+9 -2
View File
@@ -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);
}
}