refactor(frontend, server): backport stream admin route handling solution to user admin
This commit is contained in:
@@ -141,8 +141,8 @@ export default {
|
||||
items: [],
|
||||
totalCount: 0
|
||||
},
|
||||
currentPage: 1,
|
||||
searchQuery: null,
|
||||
// currentPage: 1,
|
||||
// searchQuery: null,
|
||||
showConfirmDialog: false,
|
||||
showDeleteDialog: false,
|
||||
manipulatedUser: null,
|
||||
@@ -153,6 +153,22 @@ export default {
|
||||
queryLimit() {
|
||||
return parseInt(this.limit)
|
||||
},
|
||||
currentPage: {
|
||||
get() {
|
||||
return parseInt(this.page)
|
||||
},
|
||||
set(newPage) {
|
||||
this.paginateNext(newPage)
|
||||
}
|
||||
},
|
||||
searchQuery: {
|
||||
get() {
|
||||
return this.q
|
||||
},
|
||||
set: debounce(function (q) {
|
||||
this.applySearch(q)
|
||||
}, 500)
|
||||
},
|
||||
queryOffset() {
|
||||
return (this.page - 1) * this.queryLimit
|
||||
},
|
||||
@@ -167,21 +183,12 @@ export default {
|
||||
return roleItems
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
currentPage: function (newPage) {
|
||||
this.paginateNext(newPage)
|
||||
},
|
||||
searchQuery: debounce(function (newQuery) {
|
||||
this.applySearch(newQuery)
|
||||
}, 1000)
|
||||
},
|
||||
methods: {
|
||||
initiateDeleteUser(user) {
|
||||
this.showDeleteDialog = true
|
||||
this.manipulatedUser = user
|
||||
},
|
||||
async deleteUser(user) {
|
||||
console.log('deleting', user.email)
|
||||
await this.$apollo.mutate({
|
||||
mutation: gql`
|
||||
mutation($userEmail: String!) {
|
||||
|
||||
@@ -7,7 +7,7 @@ extend type Query {
|
||||
"""
|
||||
Get users from the server in a paginated view. The query search for matches in name, company and email.
|
||||
"""
|
||||
users(limit: Int!=25, offset: Int!=0, query: String=null) : UserCollection
|
||||
users(limit: Int! = 25, offset: Int! = 0, query: String=null) : UserCollection
|
||||
userSearch(
|
||||
query: String!
|
||||
limit: Int! = 25
|
||||
|
||||
Reference in New Issue
Block a user