Fix pagination bug in model-crud
This commit is contained in:
parent
985860732d
commit
09852baa84
1 changed files with 6 additions and 6 deletions
|
@ -101,9 +101,7 @@
|
||||||
:total="rowData.total"
|
:total="rowData.total"
|
||||||
:current.sync="rowPage"
|
:current.sync="rowPage"
|
||||||
:per-page="rowsPerPage"
|
:per-page="rowsPerPage"
|
||||||
@change="changeRowPagination"
|
@change="changeRowPagination">
|
||||||
>
|
|
||||||
<!-- icon-pack="fas" -->
|
|
||||||
</b-pagination>
|
</b-pagination>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -445,20 +443,22 @@ export default {
|
||||||
}
|
}
|
||||||
this.$http.get(this.getApiRowsUrl(), {params: params}).then(response => {
|
this.$http.get(this.getApiRowsUrl(), {params: params}).then(response => {
|
||||||
this.rowData = response.data
|
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 => {
|
}, response => {
|
||||||
if (response.status == 403) { // forbidden; redirect to home page
|
if (response.status == 403) { // forbidden; redirect to home page
|
||||||
this.$buefy.toast.open({
|
this.$buefy.toast.open({
|
||||||
message: "You do not have permission to access that page.",
|
message: "You do not have permission to access that page.",
|
||||||
type: 'is-danger',
|
type: 'is-danger',
|
||||||
position: 'is-bottom',
|
|
||||||
})
|
})
|
||||||
this.$router.push('/')
|
this.$router.push('/')
|
||||||
} else {
|
} else {
|
||||||
this.$buefy.toast.open({
|
this.$buefy.toast.open({
|
||||||
message: "Failed to fetch page data!",
|
message: "Failed to fetch page data!",
|
||||||
type: 'is-danger',
|
type: 'is-danger',
|
||||||
position: 'is-bottom',
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue