diff --git a/src/api/user.js b/src/api/user.js index 2dd33a75..e656ec10 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -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 }) diff --git a/src/views/users/list.vue b/src/views/users/list.vue index 6e4ecb91..8629c14f 100644 --- a/src/views/users/list.vue +++ b/src/views/users/list.vue @@ -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 ${email}, prompting them to reset their password with the provided link. Are you sure you want to do this?`, 'Warning', { confirmButtonText: 'Proceed',