()
| 127 | }, [frequencyMode, everyMinutes, selectedHour, selectedMinute, selectedDays, selectedDayOfMonth]); |
| 128 | |
| 129 | const validate = (): boolean => { |
| 130 | const newErrors: Record<string, string> = {}; |
| 131 | if (!name.trim()) newErrors.name = "Name is required"; |
| 132 | if (!schedule.trim()) newErrors.schedule = "Schedule is required"; |
| 133 | else if (!isValidCron(schedule)) newErrors.schedule = "Invalid cron expression"; |
| 134 | setErrors(newErrors); |
| 135 | return Object.keys(newErrors).length === 0; |
| 136 | }; |
| 137 | |
| 138 | const handleSubmit = async (e: React.FormEvent) => { |
| 139 | e.preventDefault(); |
no test coverage detected