List now working properly for user, user search with substring and without, one caveat is that if you type something into the search bar but don't search it'll act as if you're trying to do a substring search.. Might be an annoying bug or might not matter

This commit is contained in:
Phoenix 2019-09-16 13:59:00 +01:00
parent 32cf6f0d11
commit bc81cbb6e2
2 changed files with 12 additions and 6 deletions

View File

@ -42,9 +42,10 @@ export function logout() {
})
}
export function fetchSubstringList(substring, query) {
export function fetchSubstringList(substring, query) { // This query expects that you have setthe platform in the calling class
return axios.get(`${apiUrl}/user/search/${substring}/`, { params: query })
}
export function fetchList(query) {
query.platform = store.state.platform
return axios.get(`${apiUrl}/user/search`, { params: query })

View File

@ -109,12 +109,13 @@ export default {
// this.listQuery.type = this.$route.meta.type
this.listQuery.platform = this.$store.state.settings.platform
this.getList()
this.getFullList()
},
methods: {
getList() {
getFullList() {
this.listLoading = true
fetchList(this.listQuery).then(response => {
console.log(response.data.docs)
this.list = response.data.docs
this.total = response.data.total
this.listLoading = false
@ -127,14 +128,18 @@ export default {
this.total = response.data.total
})
},
handleFilter() {
this.listQuery.page = 1
getList() {
console.log(this.listQuery)
if (this.substring === '') {
this.getList
this.getFullList()
} else {
this.getSubstring()
}
},
handleFilter() {
this.listQuery.page = 1
this.getList()
},
sendPasswordResetConfirm(email) {
this.$confirm(`This will send an email to <b>${email}</b>, prompting them to reset their password with the provided link. Are you sure you want to do this?`, 'Warning', {
confirmButtonText: 'Proceed',