Prechádzať zdrojové kódy

Update doc-survey-widget.tsx

Stefan Pejcic 1 rok pred
rodič
commit
160d5c9396

+ 4 - 0
documentation/src/refine-theme/doc-survey-widget.tsx

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