schedule name can be empty

This commit is contained in:
proddy
2024-07-11 10:42:35 +02:00
parent 0de73c8c85
commit e1ecb78375

View File

@@ -287,6 +287,7 @@ export const uniqueNameValidator = (schedule: ScheduleItem[], o_name?: string) =
callback: (error?: string) => void callback: (error?: string) => void
) { ) {
if ( if (
name !== '' &&
(o_name === undefined || o_name !== name) && (o_name === undefined || o_name !== name) &&
schedule.find((si) => si.name === name) schedule.find((si) => si.name === name)
) { ) {
@@ -305,9 +306,7 @@ export const schedulerItemValidation = (
name: [ name: [
{ {
type: 'string', type: 'string',
min: 0, pattern: /^[a-zA-Z0-9_\\.]{0,15}$/,
max: 15,
pattern: /^[a-zA-Z0-9_\\.]{1,15}$/,
message: "Must be <15 characters: alpha numeric, '_' or '.'" message: "Must be <15 characters: alpha numeric, '_' or '.'"
}, },
...[uniqueNameValidator(schedule, scheduleItem.o_name)] ...[uniqueNameValidator(schedule, scheduleItem.o_name)]