diff --git a/src/api/terminal.js b/src/api/terminal.js
index 8f1272f3..9d846580 100644
--- a/src/api/terminal.js
+++ b/src/api/terminal.js
@@ -4,8 +4,7 @@ import store from '../store/modules/settings.js'
const TerminalEndpointUrl = 'https://metadata.service.development.therig.onlinefuelslabs.io'
export function fetchList(query) {
- query.platform = store.state.platform
- return axios.get(`${TerminalEndpointUrl}/terminals`, { params: query })
+ return axios.get(`${TerminalEndpointUrl}/terminals?platform=${store.state.platform}`)
}
export function fetchTerminal(id) {
diff --git a/src/views/terminals/list.vue b/src/views/terminals/list.vue
index 6ff92d55..173b2e66 100644
--- a/src/views/terminals/list.vue
+++ b/src/views/terminals/list.vue
@@ -2,13 +2,13 @@
-
+
Search
-
+
{{ scope.row.name }}
@@ -53,36 +53,32 @@ export default {
},
data() {
return {
- list: null,
+ terminalName: '',
+ originaList: null,
+ filteredList: null,
total: 0,
- listLoading: true,
- listQuery: {
- page: 1,
- limit: 20
- }
+ listLoading: true
}
},
created() {
// Set the type for the query
- this.listQuery.type = this.$route.meta.type
- this.listQuery.platform = this.$store.state.platform
-
this.getList()
},
methods: {
getList() {
this.listLoading = true
- fetchList(this.listQuery).then(response => {
- this.list = response.data.terminals
+ fetchList().then(response => {
+ this.originaList = response.data.terminals
+ this.filteredList = this.originaList
this.total = response.data.terminals.length
this.listLoading = false
})
},
handleFilter() {
- // const searchQuery = this.accountName.toLowerCase()
- // this.filteredList = this.originalList.filter(function(account) {
- // return account.name.toLowerCase().includes(searchQuery)
- // })
+ const searchQuery = this.terminalName.toLowerCase()
+ this.filteredList = this.originaList.filter(function(terminal) {
+ return terminal.name.toLowerCase().includes(searchQuery)
+ })
}
}
}