diff --git a/packages/nulp_elite/src/pages/voting/createForm.js b/packages/nulp_elite/src/pages/voting/createForm.js index 3895c67d..11aea9b4 100644 --- a/packages/nulp_elite/src/pages/voting/createForm.js +++ b/packages/nulp_elite/src/pages/voting/createForm.js @@ -211,7 +211,7 @@ const createForm = () => { visibility, poll_options: pollOptions, poll_keywords: chips, - status: "Draft", + status: "Live", start_date: startDate, end_date: endDate, user_list: userListFinal, @@ -223,7 +223,7 @@ const createForm = () => { visibility, poll_options: pollOptions, poll_keywords: chips, - status: "Draft", + status: "Live", start_date: startDate, end_date: endDate, user_list: userList, diff --git a/packages/nulp_elite/src/pages/voting/votingDetails.js b/packages/nulp_elite/src/pages/voting/votingDetails.js index 243c62a8..8060804b 100644 --- a/packages/nulp_elite/src/pages/voting/votingDetails.js +++ b/packages/nulp_elite/src/pages/voting/votingDetails.js @@ -94,7 +94,7 @@ const VotingDetails = () => { const [currentTime, setCurrentTime] = useState(moment()); const [startDate, setStartDate] = useState(moment()); const [endDate, setEndDate] = useState(moment()); - const [updateFlag, setUpdateFlag] = useState({ live: false, closed: false }); + const [updateFlag, setUpdateFlag] = useState(false); useEffect(() => { const timer = setInterval(() => { @@ -124,13 +124,13 @@ const VotingDetails = () => { useEffect(() => { // Ensure startDate is parsed as UTC and then converted to local time const startDateLocal = moment.utc(startDate).local(); - + console.log("startDate:----", startDateLocal); // Check if the current time has passed the start date if (moment().isAfter(startDateLocal)) { if (!updateFlag) { setUpdateFlag(true); // Send update to the backend - fetch(`http://localhost:3000/polls/update?poll_id=${pollId}`, { + fetch(`${urlConfig.URLS.POLL.UPDATE}?poll_id=${pollId}`, { method: "PUT", headers: { "Content-Type": "application/json",