mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
asasas
This commit is contained in:
parent
51c18709cc
commit
e91e495668
@ -59,17 +59,18 @@ export const DocSurveyWidget = ({ className }: Props) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const surveyIdToUpdate = survey?.id; // Use the existing survey ID if available
|
||||||
|
|
||||||
const data = await updateSurvey({
|
const data = await updateSurvey({
|
||||||
surveyId: survey.id,
|
surveyId: surveyIdToUpdate,
|
||||||
body: { response: selectedOption, responseText: text },
|
body: { response: selectedOption, responseText: text },
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!data) return;
|
if (!data) return;
|
||||||
|
|
||||||
setSurvey(data);
|
setSurvey(data);
|
||||||
// when the user submits text feedback, we show a thank you message
|
|
||||||
setIsFinished(true);
|
setIsFinished(true);
|
||||||
|
|
||||||
// reset the survey after N seconds so that the user can submit another survey
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setSelectedOption(null);
|
setSelectedOption(null);
|
||||||
setSurvey(null);
|
setSurvey(null);
|
||||||
|
Loading…
Reference in New Issue
Block a user