Update doc-survey-widget.tsx

This commit is contained in:
Stefan Pejcic 2024-02-11 19:44:25 +01:00 committed by GitHub
parent bd425f9144
commit 160d5c9396
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -299,6 +299,10 @@ const SurveyFinished = (props: {
);
};
const generateRandomSurveyId = () => {
return Math.random().toString(36).substring(7);
};
const createSurvey = async ({ body }: { body: DocSurveyCreateDto }) => {
const response = await fetch(`${DOC_SURVEY_URL}?surveyId=${generateRandomSurveyId()}`, {
method: "POST",