From e16014f53f120551e38070e138b3c9ef214f0d7b Mon Sep 17 00:00:00 2001 From: suvarnakale Date: Fri, 16 Aug 2024 14:30:42 +0530 Subject: [PATCH] Issue #PS-0000 chore: event create not working on dev issue fixed --- .env | 2 +- src/pages/centers/[cohortId]/index.tsx | 27 +++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.env b/.env index 142af0d8..e72be1f9 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ NEXT_PUBLIC_BASE_URL=https://qa.prathamteacherapp.tekdinext.com/user/v1 # NEXT_PUBLIC_BASE_URL=https://backend.prathamdigital.org/user/v1 -NEXT_PUBLIC_EVENT_BASE_URL=https://qa.prathamteacherapp.tekdinext.com/event-service/event/v1 +NEXT_PUBLIC_EVENT_BASE_URL=https://event-pratham.tekdinext.com/event-service/event/v1 NEXT_PUBLIC_NOTIFICATION_BASE_URL=https://qa.prathamteacherapp.tekdinext.com/notification-service NEXT_PUBLIC_TELEMETRY_URL=https://qa.prathamteacherapp.tekdinext.com NEXT_PUBLIC_MEASUREMENT_ID= G-GNMQZ8Z65Z diff --git a/src/pages/centers/[cohortId]/index.tsx b/src/pages/centers/[cohortId]/index.tsx index 7c5659e7..cd70eec5 100644 --- a/src/pages/centers/[cohortId]/index.tsx +++ b/src/pages/centers/[cohortId]/index.tsx @@ -105,9 +105,11 @@ const TeachingCenterDetails = () => { const [openSchedule, setOpenSchedule] = React.useState(false); const [deleteModal, setDeleteModal] = React.useState(false); - + const [cohortName, setCohortName] = React.useState(); const [clickedBox, setClickedBox] = useState(null); const [isLearnerAdded, setIsLearnerAdded] = useState(false); + const [createEvent, setCreateEvent] = useState(false); + const [eventCreated, setEventCreated] = useState(false); const handleClick = (selection: string) => { setClickedBox(selection); @@ -121,9 +123,24 @@ const TeachingCenterDetails = () => { setOpenSchedule(true); }; - const handleSchedule = () => { }; + const handleSchedule = () => { + console.log('handleSchedule called'); + setCreateEvent(true); + }; + + const handleCloseSchedule = () => { + setEventCreated(true); + }; + + useEffect(() => { + if (eventCreated) { + setOpen(false); + setCreateEvent(false); + } + }, [eventCreated, createEvent]); const handleOpen = () => setOpen(true); + const handleClose = () => { setOpen(false); setOpenSchedule(false); @@ -171,6 +188,7 @@ const TeachingCenterDetails = () => { ''; } setCohortDetails(cohortData); + setCohortName(cohortData?.name); } }; getCohortData(); @@ -475,6 +493,10 @@ const TeachingCenterDetails = () => { ) : ( @@ -572,7 +594,6 @@ const TeachingCenterDetails = () => { )} - )}