feat: add validation for event name length in SiteSettingsPage to ensure it does not exceed 64 characters
This commit is contained in:
@@ -156,6 +156,10 @@ export default function SiteSettingsPage() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
const eventName = goalForm.event_name.trim().toLowerCase().replace(/\s+/g, '_')
|
const eventName = goalForm.event_name.trim().toLowerCase().replace(/\s+/g, '_')
|
||||||
|
if (eventName.length > 64) {
|
||||||
|
toast.error('Event name must be 64 characters or less')
|
||||||
|
return
|
||||||
|
}
|
||||||
if (!/^[a-zA-Z0-9_]+$/.test(eventName)) {
|
if (!/^[a-zA-Z0-9_]+$/.test(eventName)) {
|
||||||
toast.error('Event name can only contain letters, numbers, and underscores')
|
toast.error('Event name can only contain letters, numbers, and underscores')
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user