Dumb implementation for updating records list after service update

This commit is contained in:
nemunaire 2020-10-08 10:57:44 +02:00
parent 0d78dcc1fe
commit d0cd1c5b96

View File

@ -120,27 +120,33 @@ export default {
watch: {
displayFormat: function (df) {
if (df === 'records' && !this.serviceRecords) {
this.getServiceRecords()
this.updateServiceRecords()
}
},
service: function (svc) {
if (this.serviceRecords) {
this.updateServiceRecords()
}
}
},
mounted () {
if (this.displayFormat === 'records') {
this.getServiceRecords()
}
this.updateServiceRecords()
},
methods: {
getServiceRecords () {
ZoneApi.getServiceRecords(this.origin, this.zoneId, this.service)
.then(response => {
this.serviceRecords = response.data
})
},
toogleShowDetails () {
this.showDetails = !this.showDetails
},
updateServiceRecords () {
if (this.displayFormat === 'records') {
ZoneApi.getServiceRecords(this.origin, this.zoneId, this.service)
.then(response => {
this.serviceRecords = response.data
})
}
}
}
}