1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00

(bug) cannot create event

This commit is contained in:
Du Peng 2023-07-11 16:07:37 +02:00
parent 770d1edbe6
commit 9dc85ee80b

View File

@ -100,7 +100,7 @@ export const EventForm: React.FC<EventFormProps> = ({ action, event, onError, on
* Callback triggered when the user validates the machine form: handle create or update
*/
const onSubmit: SubmitHandler<Event> = (data: Event) => {
if (data.pre_registration_end_date.toString() === 'Invalid Date') {
if (data.pre_registration_end_date?.toString() === 'Invalid Date') {
data.pre_registration_end_date = null;
}
if (action === 'update') {