Fixed a bug with accounts not filtering by buyer and seller

This commit is contained in:
Chad Derya 2019-09-09 11:45:30 +01:00
parent fbcf66a247
commit 71cfd9a108
2 changed files with 7 additions and 8 deletions

View File

@ -4,12 +4,7 @@ import store from '../store/modules/settings.js'
const apiUrl = 'https://users.service.development.therig.onlinefuelslabs.io'
export function fetchList(query) {
const dto = {
'page': query.page,
'limit': query.limit,
'platform': query.platform || store.state.platform
}
return axios.get(`${apiUrl}/account/search`, { params: dto })
return axios.get(`${apiUrl}/account/search`, { params: query })
}
export function fetchAccount(id) {

View File

@ -49,7 +49,7 @@
</template>
<script>
import { fetchList } from '@/api/account'
const fetchAccountList = require('@/api/account').fetchList
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
export default {
@ -86,11 +86,15 @@ export default {
methods: {
getList() {
this.listLoading = true
fetchList(this.listQuery).then(response => {
fetchAccountList(this.listQuery).then(response => {
this.list = response.data.docs
this.total = response.data.total
this.listLoading = false
})
},
handleFilter(query) {
this.listQuery.page = 1
this.getList()
}
}
}