Skip to content

Commit

Permalink
Fix bug with adding services
Browse files Browse the repository at this point in the history
  • Loading branch information
tobuck-aws committed Apr 6, 2022
1 parent 3251e1f commit 3822fc1
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions client/web/src/settings/ApplicationComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,16 @@ export function ApplicationComponent(props) {

const findServicesWithErrors = (formik) => {
let servicesWithErrors = []
if (!!formik.errors.services) {
formik.errors.services.forEach((service, index) => {
if (!!service) {
servicesWithErrors.push(formik.values.services[index].name)
}
})
if (!!formik?.errors?.services) {
if (typeof formik.errors.services === 'string') {
servicesWithErrors.push(formik.errors.services)
} else {
formik.errors.services?.forEach((service, index) => {
if (!!service) {
servicesWithErrors.push(formik.values?.services[index].name)
}
})
}
}
return servicesWithErrors.join(', ')
}
Expand Down

0 comments on commit 3822fc1

Please sign in to comment.