Fix pagination bug in model-crud
This commit is contained in:
parent
985860732d
commit
09852baa84
|
@ -101,9 +101,7 @@
|
|||
:total="rowData.total"
|
||||
:current.sync="rowPage"
|
||||
:per-page="rowsPerPage"
|
||||
@change="changeRowPagination"
|
||||
>
|
||||
<!-- icon-pack="fas" -->
|
||||
@change="changeRowPagination">
|
||||
</b-pagination>
|
||||
</div>
|
||||
|
||||
|
@ -445,20 +443,22 @@ export default {
|
|||
}
|
||||
this.$http.get(this.getApiRowsUrl(), {params: params}).then(response => {
|
||||
this.rowData = response.data
|
||||
|
||||
// TODO: for some reason rowPage is getting reset to 0, maybe by
|
||||
// the b-pagination component? for now this is our workaround
|
||||
if (!this.rowPage) {
|
||||
this.rowPage = 1
|
||||
}
|
||||
}, response => {
|
||||
if (response.status == 403) { // forbidden; redirect to home page
|
||||
this.$buefy.toast.open({
|
||||
message: "You do not have permission to access that page.",
|
||||
type: 'is-danger',
|
||||
position: 'is-bottom',
|
||||
})
|
||||
this.$router.push('/')
|
||||
} else {
|
||||
this.$buefy.toast.open({
|
||||
message: "Failed to fetch page data!",
|
||||
type: 'is-danger',
|
||||
position: 'is-bottom',
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue