Skip to content

Commit

Permalink
Clear errors on form submit
Browse files Browse the repository at this point in the history
  • Loading branch information
Pezmc committed Dec 22, 2023
1 parent 1fe825a commit 40d02b0
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ export default {
return
}

this.error = null
this.errors = {}

const flowBlueprintProps = { ...this.input }
if (flowBlueprintProps.order === '') {
delete flowBlueprintProps.order
Expand Down Expand Up @@ -170,11 +173,11 @@ export default {
if (error.response?.data?.error) {
const errorResponse = error.response.data
this.error = errorResponse.error
if (errorResponse.message.includes('flows')) {
this.errors.flows = errorResponse.message
if (this.error.includes('flows')) {
this.errors.flows = this.error
}
if (errorResponse.message.includes('modules')) {
this.errors.modules = errorResponse.message
if (this.error.includes('modules')) {
this.errors.modules = this.error
}
} else {
this.error = 'Unknown error, please try again'
Expand Down

0 comments on commit 40d02b0

Please sign in to comment.