fixed getting data for completing a survey

This commit is contained in:
Tatiana Nikolaeva 2025-06-02 16:00:19 +05:00
parent 88dcb63232
commit 2ec9354fc1
13 changed files with 128 additions and 55 deletions

View file

@ -153,11 +153,9 @@ class ActionQueue {
}
export const SurveyPage: React.FC = () => {
// const [survey, setSurvey] = useState<ISurvey | null>(null);
const [questions, setQuestions] = useState<Question[]>([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
// const { surveyId } = useParams<{ surveyId: string }>();
const [description, setDescription] = useState('');
const [title, setTitle] = useState('');
@ -173,7 +171,6 @@ export const SurveyPage: React.FC = () => {
return;
}
// const id = parseInt(survey.id);
const id = survey.id;
if (isNaN(id)) {
console.error('Invalid survey ID');
@ -183,7 +180,6 @@ export const SurveyPage: React.FC = () => {
const fetchData = async () => {
try {
setLoading(true);
// const surveyData = await getSurveyById(id);
setSurvey(survey);
setTitle(survey.title);
setDescription(survey.description);
@ -218,7 +214,6 @@ export const SurveyPage: React.FC = () => {
try {
setError(null);
// const id = parseInt(survey.id);
const id = survey.id;
const actionQueue = new ActionQueue();