mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
schedule name can be empty
This commit is contained in:
@@ -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)]
|
||||||
|
|||||||
Reference in New Issue
Block a user