MCPcopy Create free account
hub / github.com/Fibi66/FeiControl / validate

Function validate

src/components/CronJobModal.tsx:129–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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();

Callers 1

handleSubmitFunction · 0.85

Calls 1

isValidCronFunction · 0.90

Tested by

no test coverage detected