Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blueprint Admin: Fix form validation #3270

Merged
merged 2 commits into from
Dec 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default {
},
computed: {
formValid () {
return this.input.name && this.input.flows && this.input.modules && !this.errors.name && !this.errors.flows && !this.errors.modules
return this.input.name && this.input.flows && this.input.modules
},
dialogTitle () {
return this.flowBlueprint?.id ? 'Edit Flow Blueprint' : 'Create Flow Blueprint'
Expand All @@ -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