terminals displays right name when switching platform
This commit is contained in:
parent
cf031cf4fd
commit
f629755bf4
|
@ -1,13 +1,15 @@
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
import store from '../store/modules/settings.js'
|
||||||
|
|
||||||
const TerminalEndpointUrl = 'https://metadata.service.development.therig.onlinefuelslabs.io'
|
const TerminalEndpointUrl = 'https://metadata.service.development.therig.onlinefuelslabs.io'
|
||||||
|
|
||||||
export function fetchList(query) {
|
export function fetchList(query) {
|
||||||
|
query.platform = store.state.platform
|
||||||
return axios.get(`${TerminalEndpointUrl}/terminals`, { params: query })
|
return axios.get(`${TerminalEndpointUrl}/terminals`, { params: query })
|
||||||
}
|
}
|
||||||
|
|
||||||
export function fetchTerminal(id) {
|
export function fetchTerminal(id) {
|
||||||
return axios.get(`${TerminalEndpointUrl}/terminal/${id}?platform=OLFDE`)
|
return axios.get(`${TerminalEndpointUrl}/terminal/${id}?platform=${store.state.platform}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createTerminal(data) {
|
export function createTerminal(data) {
|
||||||
|
@ -23,7 +25,7 @@ export function updateTerminal(data) {
|
||||||
function __dataToDTO(data) {
|
function __dataToDTO(data) {
|
||||||
return {
|
return {
|
||||||
'name': data.name,
|
'name': data.name,
|
||||||
'platform': data.platform || 'OLFDE',
|
'platform': store.state.platform,
|
||||||
'addressLine1': data.address.addressLine1,
|
'addressLine1': data.address.addressLine1,
|
||||||
'addressLine2': data.address.addressLine2,
|
'addressLine2': data.address.addressLine2,
|
||||||
'county': data.address.county,
|
'county': data.address.county,
|
||||||
|
|
|
@ -61,7 +61,7 @@ export default {
|
||||||
created() {
|
created() {
|
||||||
// Set the type for the query
|
// Set the type for the query
|
||||||
this.listQuery.type = this.$route.meta.type
|
this.listQuery.type = this.$route.meta.type
|
||||||
this.listQuery.platform = 'OLFDE'
|
this.listQuery.platform = this.$store.state.platform
|
||||||
|
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue