|
@@ -81,7 +81,7 @@ const EditSourcesModal = ({ onSave }) => {
|
|
validate: (values) => {
|
|
validate: (values) => {
|
|
const errors = {};
|
|
const errors = {};
|
|
|
|
|
|
- values.sources.forEach((source, index) => {
|
|
|
|
|
|
+ values.sources && values.sources.forEach((source, index) => {
|
|
if (source.Name === '') {
|
|
if (source.Name === '') {
|
|
errors[`sources.${index}.Name`] = 'Name is required';
|
|
errors[`sources.${index}.Name`] = 'Name is required';
|
|
}
|
|
}
|
|
@@ -105,7 +105,7 @@ const EditSourcesModal = ({ onSave }) => {
|
|
<form onSubmit={formik.handleSubmit}>
|
|
<form onSubmit={formik.handleSubmit}>
|
|
<DialogContent>
|
|
<DialogContent>
|
|
<Stack spacing={2}>
|
|
<Stack spacing={2}>
|
|
- {formik.values.sources
|
|
|
|
|
|
+ {formik.values.sources && formik.values.sources
|
|
.map((action, index) => {
|
|
.map((action, index) => {
|
|
return !action.removed && <>
|
|
return !action.removed && <>
|
|
<Stack spacing={0} key={index}>
|
|
<Stack spacing={0} key={index}>
|