From e4f0ae150a35d34bb6225a9d72014be480a0ee07 Mon Sep 17 00:00:00 2001 From: Akshith <33996844+akshith312@users.noreply.github.com> Date: Wed, 4 Mar 2026 16:59:40 -0800 Subject: [PATCH] fix: max attendees accepting negative and decimal values --- .../Reports/Participation/CreateEventModal.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/CommunityPortal/Reports/Participation/CreateEventModal.jsx b/src/components/CommunityPortal/Reports/Participation/CreateEventModal.jsx index 5707d9a506..3f5535e64c 100644 --- a/src/components/CommunityPortal/Reports/Participation/CreateEventModal.jsx +++ b/src/components/CommunityPortal/Reports/Participation/CreateEventModal.jsx @@ -102,6 +102,10 @@ function CreateEventModal({ isOpen, toggle }) { newErrors.maxAttendees = 'Max attendees must be at least 1'; } + if (formData.maxAttendees < 0 || !Number.isInteger(formData.maxAttendees)) { + newErrors.maxAttendees = 'Max Attendees must be a Positive Integer'; + } + // Validate that end time is after start time if (formData.startTime && formData.endTime) { const start = moment(`${formData.date} ${formData.startTime}`, 'YYYY-MM-DD HH:mm');