Skip to content

Commit

Permalink
Changed setData logic in Survey Comp
Browse files Browse the repository at this point in the history
  • Loading branch information
sergesoroka authored and kerberizer committed Dec 5, 2024
1 parent 4e639a9 commit 6aa07d3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/SurveyComp/SurveyComp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ function SurveyComponent({ setResult }) {
const apiUrl = config.apiUrl;
const response = await fetch(`${apiUrl}/${id}`);
const data = await response.json();

setIntermediateData(data);
// populate survye.js with data from API
survey.data = data;
if (data.template_status == "FINALIZED") {
Expand All @@ -58,8 +60,7 @@ function SurveyComponent({ setResult }) {

useEffect(() => {
getTemplateInfo();
setIntermediateData(survey.data);
}, [getTemplateInfo, id, setIntermediateData]);
}, [getTemplateInfo]);

window["$"] = window["jQuery"] = $;
// require("easy-autocomplete/dist/jquery.easy-autocomplete.js");
Expand Down

0 comments on commit 6aa07d3

Please sign in to comment.