Explorar el Código

Update doc-survey-widget.tsx

Stefan Pejcic hace 1 año
padre
commit
bd425f9144
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      documentation/src/refine-theme/doc-survey-widget.tsx

+ 3 - 2
documentation/src/refine-theme/doc-survey-widget.tsx

@@ -300,7 +300,7 @@ const SurveyFinished = (props: {
 };
 };
 
 
 const createSurvey = async ({ body }: { body: DocSurveyCreateDto }) => {
 const createSurvey = async ({ body }: { body: DocSurveyCreateDto }) => {
-    const response = await fetch(`${DOC_SURVEY_URL}/responses`, {
+    const response = await fetch(`${DOC_SURVEY_URL}?surveyId=${generateRandomSurveyId()}`, {
         method: "POST",
         method: "POST",
         headers: {
         headers: {
             "Content-Type": "application/json",
             "Content-Type": "application/json",
@@ -316,6 +316,7 @@ const createSurvey = async ({ body }: { body: DocSurveyCreateDto }) => {
     return data;
     return data;
 };
 };
 
 
+
 const updateSurvey = async ({
 const updateSurvey = async ({
     surveyId,
     surveyId,
     body,
     body,
@@ -323,7 +324,7 @@ const updateSurvey = async ({
     surveyId?: string;
     surveyId?: string;
     body: DocSurveyUpdateDto;
     body: DocSurveyUpdateDto;
 }) => {
 }) => {
-    const response = await fetch(`${DOC_SURVEY_URL}/responses/${surveyId}`, {
+    const response = await fetch(`${DOC_SURVEY_URL}?surveyId=${surveyId}`, {
         method: "PATCH",
         method: "PATCH",
         headers: {
         headers: {
             "Content-Type": "application/json",
             "Content-Type": "application/json",