mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 04:14:04 +00:00
Merge branch 'feature/rate-integration' into 'master'
Feature/rate integration See merge request CIEFWorldwideSdnBhd/exchange!54
This commit is contained in:
@@ -35,7 +35,7 @@ class RateController extends Controller
|
||||
|
||||
public function show()
|
||||
{
|
||||
$rate = DB::table('rates')->latest()->first();
|
||||
$rate = Rate::latest()->first();
|
||||
|
||||
return response()->json($rate, 200);
|
||||
}
|
||||
|
||||
@@ -7,4 +7,5 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Rate extends Model
|
||||
{
|
||||
protected $fillable = ['x1_cash','x1_cheque','x1_ba','x2_cash','x2_cheque','x2_ba'];
|
||||
protected $hidden = ['id'];
|
||||
}
|
||||
|
||||
@@ -57,13 +57,13 @@
|
||||
<div class="grid-content bg-purple" align="left">X1 :</div>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">1.70</div>
|
||||
<div class="grid-content bg-purple" align="center">{{ rate.x1_cash }}</div>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">1.64</div>
|
||||
<div class="grid-content bg-purple" align="center">{{ rate.x1_cheque }}</div>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">1.62</div>
|
||||
<div class="grid-content bg-purple" align="center">{{ rate.x1_ba }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -104,13 +104,13 @@
|
||||
<div class="grid-content bg-purple" align="left">X2 :</div>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">1.56</div>
|
||||
<div class="grid-content bg-purple" align="center">{{ rate.x2_cash }}</div>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">1.64</div>
|
||||
<div class="grid-content bg-purple" align="center">{{ rate.x2_cheque }}</div>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">1.62</div>
|
||||
<div class="grid-content bg-purple" align="center">{{ rate.x2_ba }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -309,6 +309,14 @@ export default {
|
||||
term: '',
|
||||
amount: ''
|
||||
}),
|
||||
rate: {
|
||||
x1_ba: null,
|
||||
x1_cheque: null,
|
||||
x1_cash: null,
|
||||
x2_ba: null,
|
||||
x2_cash: null,
|
||||
x2_cheque: null,
|
||||
},
|
||||
loading: false,
|
||||
status: '',
|
||||
booking: {
|
||||
@@ -382,9 +390,10 @@ export default {
|
||||
mounted () {
|
||||
this.getBooking()
|
||||
this.RefreshBooking()
|
||||
this.getRate()
|
||||
},
|
||||
methods: {
|
||||
getBooking() {
|
||||
getRate(){
|
||||
let $this = this
|
||||
axios.get(this.url).then(response => {
|
||||
this.bookingTable = response.data.data
|
||||
@@ -392,6 +401,13 @@ export default {
|
||||
$this.makePagination(response.data)
|
||||
})
|
||||
},
|
||||
getBooking() {
|
||||
let $this = this
|
||||
axios.get('api/rate').then(response => {
|
||||
this.rate = response.data
|
||||
console.log(this.rate)
|
||||
})
|
||||
},
|
||||
RefreshBooking() {
|
||||
let $this = this
|
||||
axios.get(this.url).then(response => {
|
||||
|
||||
+2
-6
@@ -21,7 +21,7 @@ Route::middleware('auth:api')->get('/user', function (Request $request) {
|
||||
return $request->user();
|
||||
});
|
||||
|
||||
|
||||
Route::get('rate', 'RateController@show');
|
||||
//Route::middleware('auth:api')->get('/user', function (Request $request) {
|
||||
// return $request->user();
|
||||
//});
|
||||
@@ -44,7 +44,6 @@ Route::group(['middleware' => 'auth:api'], function () {
|
||||
Route::post('booking/{book_id}/cancel', 'BookingController@cancel');
|
||||
Route::get('/booking', 'BookingController@index');
|
||||
Route::get('/user', 'UserController@show');
|
||||
|
||||
Route::patch('settings/profile', 'Settings\ProfileController@update');
|
||||
Route::patch('settings/password', 'Settings\PasswordController@update');
|
||||
});
|
||||
@@ -56,7 +55,6 @@ Route::group(['middleware' => 'guest:api'], function () {
|
||||
Route::post('register', 'Auth\RegisterController@create');
|
||||
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
|
||||
Route::post('password/reset', 'Auth\ResetPasswordController@reset');
|
||||
|
||||
Route::post('oauth/{driver}', 'Auth\OAuthController@redirectToProvider');
|
||||
Route::get('oauth/{driver}/callback', 'Auth\OAuthController@handleProviderCallback')->name('oauth.callback');
|
||||
});
|
||||
@@ -64,14 +62,12 @@ Route::group(['middleware' => 'guest:api'], function () {
|
||||
Route::group(['middleware' => ['role:admin']], function() {
|
||||
Route::get('admin/booking/', 'BookingController@adminIndex');
|
||||
Route::get('admin/booking/{id}', 'BookingController@adminShow');
|
||||
|
||||
Route::post('update-rate', 'RateController@store');
|
||||
Route::put('update-rate/{rate}', 'RateController@update');
|
||||
Route::delete('update-rate/{rate}', 'RateController@delete');
|
||||
Route::get('update-rate', 'RateController@index');
|
||||
|
||||
//show current rate
|
||||
Route::get('rate', 'RateController@show');
|
||||
|
||||
|
||||
Route::get('setting-credit', 'SettingCreditController@index');
|
||||
Route::get('setting-credit/{credit}', 'SettingCreditController@show');
|
||||
|
||||
Reference in New Issue
Block a user