Fix planning modal issues

This commit is contained in:
Jérémy Munsch 2021-10-22 12:56:27 +02:00
parent 7f89b898e0
commit d343c629b9
No known key found for this signature in database
GPG key ID: 55196BEE445F6049

View file

@ -277,6 +277,15 @@ export default {
default: this.dDisplay = false
}
},
resetModalFields() {
this.$set(this, 'currentType' , null)
this.$set(this, 'value' , {
label: null,
value: null
})
this.$refs.type.value = ''
this.$refs.morph.value = ''
},
search (search = null) {
this.$nextTick(() => {
this.error = null
@ -357,10 +366,7 @@ export default {
this.$refs.text.value = cellData.text
this.$nextTick(() => {
let route = null
this.value = {
label: null,
value: null
}
this.resetModalFields()
switch(this.currentModel) {
case 'tickets':
this.dDisplay = true
@ -382,19 +388,6 @@ export default {
break
default: this.dDisplay = false
}
if(route) {
axios.get(route).then(response => {
this.value = response.data
}).catch(error => {
if(error.response.status === 429) {
location.reload()
}
this.error = error
}).then(() => {
this.loading = false
})
this.search()
}
})
},
limitLines(e) {