diff --git a/src/pages/Dashboard/AddEvent/AddEvent.jsx b/src/pages/Dashboard/AddEvent/AddEvent.jsx index 9025096a7..d50ccfa1c 100644 --- a/src/pages/Dashboard/AddEvent/AddEvent.jsx +++ b/src/pages/Dashboard/AddEvent/AddEvent.jsx @@ -208,7 +208,9 @@ function AddEvent() { navigate(`${PathName.Dashboard}/${calendarId}${PathName.Events}`).catch((error) => console.log(error)), ); }) - .catch((error) => console.log(error)); + .catch((error) => { + console.log(error); + }); }; useEffect(() => { @@ -636,15 +638,20 @@ function AddEvent() { ({ validator() { - if (!getFieldValue('dragger') || getFieldValue('dragger')?.length == 0) { - console.log(getFieldValue('dragger')); + if ( + (getFieldValue('dragger') != undefined && getFieldValue('dragger')?.length > 0) || + (eventData?.image?.original && !getFieldValue('dragger')) || + (eventData?.image?.original && getFieldValue('dragger')?.length > 0) + ) { + return Promise.resolve(); + } else return Promise.reject( new Error(t('dashboard.events.addEditEvent.validations.otherInformation.emptyImage')), ); - } else return Promise.resolve(); }, }), ]}>