diff --git a/src/components/dashboard/EventsSection/EventCheckIn.tsx b/src/components/dashboard/EventsSection/EventCheckIn.tsx index 9f38ee3..a4a5f01 100644 --- a/src/components/dashboard/EventsSection/EventCheckIn.tsx +++ b/src/components/dashboard/EventsSection/EventCheckIn.tsx @@ -247,48 +247,43 @@ const EventCheckIn = () => { -
- { - if (e.key === "Enter") { - e.preventDefault(); - const input = e.target as HTMLInputElement; - if (input.value.trim()) { - setIsLoading(true); - handleEventCheckIn(input.value.trim()).finally(() => { - setIsLoading(false); - input.value = ""; - }); +
{ + e.preventDefault(); + const input = e.currentTarget.querySelector('input') as HTMLInputElement; + if (input.value.trim()) { + setIsLoading(true); + handleEventCheckIn(input.value.trim()).finally(() => { + setIsLoading(false); + input.value = ""; + }); + } else { + createToast("Please enter an event code", "warning"); + } + }}> +
+ { + if (e.key === "Enter") { + e.preventDefault(); } - } - }} - /> - -
+ }} + /> + +
+ diff --git a/src/components/dashboard/Officer_EventManagement/Attendees.tsx b/src/components/dashboard/Officer_EventManagement/Attendees.tsx index 2deb387..03f80e6 100644 --- a/src/components/dashboard/Officer_EventManagement/Attendees.tsx +++ b/src/components/dashboard/Officer_EventManagement/Attendees.tsx @@ -232,7 +232,6 @@ export default function Attendees() { let isMounted = true; const fetchEventData = async () => { if (!eventId || !auth.isAuthenticated()) { - if (!eventId) console.log('No eventId provided'); if (!auth.isAuthenticated()) { console.log('User not authenticated'); setError('Authentication required');