This commit is contained in:
Malini 2026-01-27 18:39:43 +05:30
parent 8c708f9bd7
commit 0b480b0aae
3 changed files with 16 additions and 10 deletions

View File

@ -146,6 +146,8 @@ const EstablishmentInfo = ({
endDate: data.end_date || '' endDate: data.end_date || ''
}; };
localStorage.setItem('currentSurveyPeriod', JSON.stringify(surveyPeriod)); localStorage.setItem('currentSurveyPeriod', JSON.stringify(surveyPeriod));
localStorage.setItem('currentQuarter', data.quarter); // Store quarter separately
localStorage.setItem('currentYear', data.year);
return surveyPeriod; return surveyPeriod;
} }
@ -154,6 +156,8 @@ const EstablishmentInfo = ({
const { quarter, year, endDate } = location.state.survey; const { quarter, year, endDate } = location.state.survey;
const surveyPeriod = { quarter, year, endDate }; const surveyPeriod = { quarter, year, endDate };
localStorage.setItem('currentSurveyPeriod', JSON.stringify(surveyPeriod)); localStorage.setItem('currentSurveyPeriod', JSON.stringify(surveyPeriod));
localStorage.setItem('currentQuarter', quarter); // Store quarter separately
localStorage.setItem('currentYear', year); // Store year separately
return surveyPeriod; return surveyPeriod;
} }
@ -394,7 +398,7 @@ const EstablishmentInfo = ({
day: 'numeric' day: 'numeric'
}) })
) : ( ) : (
<span className="text-amber-600">To be announced</span> <span className="text-amber-600">-</span>
)} )}
</span> </span>
</div> </div>

View File

@ -1211,7 +1211,7 @@ const location = useLocation();
day: 'numeric' day: 'numeric'
}) })
) : ( ) : (
<span className="text-amber-600">To be announced</span> <span className="text-amber-600">-</span>
); );
})()} })()}
</div> </div>

View File

@ -351,15 +351,17 @@ const ReviewSubmit = ({
const fetchQuarterPeriods = async () => { const fetchQuarterPeriods = async () => {
try { try {
setIsLoading(true); setIsLoading(true);
const savedSurveyPeriod = localStorage.getItem('currentSurveyPeriod'); // const savedSurveyPeriod = localStorage.getItem('currentSurveyPeriod');
if (!savedSurveyPeriod) { // if (!savedSurveyPeriod) {
throw new Error('No survey period found in localStorage'); // throw new Error('No survey period found in localStorage');
} // }
const { quarter, year } = JSON.parse(savedSurveyPeriod); // const { quarter, year } = JSON.parse(savedSurveyPeriod);
if (!quarter || !year) { // if (!quarter || !year) {
throw new Error('Incomplete survey period data'); // throw new Error('Incomplete survey period data');
} // }
const quarter = localStorage.getItem('currentQuarter');
const year = localStorage.getItem('currentYear');
const response = await getQuarterPeriods(year, quarter); const response = await getQuarterPeriods(year, quarter);
if (response.status === 'success') { if (response.status === 'success') {