Skip to content

Commit

Permalink
Issue #PS-0000 chore: event create not working on dev issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
suvarnakale committed Aug 16, 2024
1 parent 15b8452 commit e16014f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -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
Expand Down
27 changes: 24 additions & 3 deletions src/pages/centers/[cohortId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,11 @@ const TeachingCenterDetails = () => {
const [openSchedule, setOpenSchedule] = React.useState(false);

const [deleteModal, setDeleteModal] = React.useState(false);

const [cohortName, setCohortName] = React.useState<string>();
const [clickedBox, setClickedBox] = useState<string | null>(null);
const [isLearnerAdded, setIsLearnerAdded] = useState(false);
const [createEvent, setCreateEvent] = useState(false);
const [eventCreated, setEventCreated] = useState(false);

const handleClick = (selection: string) => {
setClickedBox(selection);
Expand All @@ -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);
Expand Down Expand Up @@ -171,6 +188,7 @@ const TeachingCenterDetails = () => {
'';
}
setCohortDetails(cohortData);
setCohortName(cohortData?.name);
}
};
getCohortData();
Expand Down Expand Up @@ -475,6 +493,10 @@ const TeachingCenterDetails = () => {
<PlannedSession
clickedBox={clickedBox}
removeModal={removeModal}
scheduleEvent={createEvent}
cohortName={cohortName}
cohortId={cohortId}
onCloseModal={handleCloseSchedule}
/>
) : (
<Schedule clickedBox={clickedBox} handleClick={handleClick} />
Expand Down Expand Up @@ -572,7 +594,6 @@ const TeachingCenterDetails = () => {
</Box>
)}
</Grid>

</Box>
</>
)}
Expand Down

0 comments on commit e16014f

Please sign in to comment.