pagination for user list on creation page

This commit is contained in:
Moriz Wahl 2022-01-14 13:32:44 +01:00
parent 5d9cc6ae24
commit d88c16a66c

View File

@ -18,6 +18,13 @@
:creation="creation"
@update-item="updateItem"
/>
<b-pagination
pills
v-model="currentPage"
per-page="25"
:total-rows="rows"
align="center"
></b-pagination>
</b-col>
<b-col cols="12" lg="6" class="shadow p-3 mb-5 rounded bg-info">
<user-table
@ -101,6 +108,8 @@ export default {
radioSelectedMass: '',
criteria: '',
creation: [null, null, null],
rows: 0,
currentPage: 1,
}
},
async created() {
@ -113,9 +122,11 @@ export default {
query: searchUsers,
variables: {
searchText: this.criteria,
currentPage: this.currentPage,
},
})
.then((result) => {
this.rows = result.data.searchUsers.userCount
this.itemsList = result.data.searchUsers.userList.map((user) => {
return {
...user,
@ -153,5 +164,13 @@ export default {
this.itemsMassCreation = []
},
},
watch: {
currentPage() {
this.getUsers()
},
criteria() {
this.getUsers()
},
},
}
</script>