@@ -29,6 +33,7 @@
+
@@ -95,10 +100,13 @@ export default {
created() {
this.initialiseFormData()
+
+ if (this.selfUpdate) {
+ this.getFormData()
+ }
},
methods: {
-
initialiseFormData() {
/*
This function initialises the form data.
@@ -154,8 +162,12 @@ export default {
// Send a quick request
axios.post(this.submitApiUri, params)
.then(response => {
+ // Do something with the response
console.log(response)
- // TODO: Have this perform a GET request to update all available parameters
+ // Update the form data if we're self-updating
+ if (this.selfUpdate) {
+ this.getFormData()
+ }
})
.catch(error => {
this.modalError(error) // Let mixin handle error
@@ -171,7 +183,7 @@ export default {
return this.$store.dispatch('pollTask', [response.data.id, null, null])
})
.then(response => {
- console.log("Successfully finished task with response:")
+ // Do something with the response
console.log(response)
})
.catch(error => {
@@ -180,6 +192,10 @@ export default {
.finally(() => {
console.log("Cleaning up after task.")
this.taskRunning = false
+ // Update the form data if we're self-updating
+ if (this.selfUpdate) {
+ this.getFormData()
+ }
})
},