fix pagination for admin booking table

This commit is contained in:
lonetrinity
2018-07-24 14:10:31 +08:00
parent ae7bf422de
commit 74e602836b
2 changed files with 9 additions and 7 deletions
+1 -1
View File
@@ -80,7 +80,7 @@ class BookingController extends Controller
$user = Auth::user();
$bookings = Booking::select('user_id', 'id', 'created_at', 'admin_status', 'rate', 'term', 'amount', 'bia', 'verification_status')
->orderby('updated_at','desc')
->get();
->paginate(10);
// reformat to fit frontend structure
foreach ($bookings as $booking) {
+8 -6
View File
@@ -67,11 +67,11 @@ export default {
middleware: 'admin',
data () {
return {
status: null,
pagination: [],
bookingTable: [
],
status: null,
prev_page_url: null,
bookingTable: [],
url: 'api/admin/booking',
pagination: [],
loading_btn: false,
}
},
@@ -79,10 +79,12 @@ export default {
this.getBooking()
},
methods: {
getBooking() {
getBooking(){
let $this = this
axios.get(this.url).then(response => {
this.bookingTable = response.data
this.bookingTable = response.data.data
$this.makePagination(response.data)
console.log(response)
})
},
RefreshBooking() {