From bd425f914437a8ab7b87c6377bf1111221282dcd Mon Sep 17 00:00:00 2001 From: Stefan Pejcic Date: Sun, 11 Feb 2024 19:40:10 +0100 Subject: [PATCH] Update doc-survey-widget.tsx --- documentation/src/refine-theme/doc-survey-widget.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/documentation/src/refine-theme/doc-survey-widget.tsx b/documentation/src/refine-theme/doc-survey-widget.tsx index 1012b81c..175a4fe4 100644 --- a/documentation/src/refine-theme/doc-survey-widget.tsx +++ b/documentation/src/refine-theme/doc-survey-widget.tsx @@ -300,7 +300,7 @@ const SurveyFinished = (props: { }; 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", headers: { "Content-Type": "application/json", @@ -316,6 +316,7 @@ const createSurvey = async ({ body }: { body: DocSurveyCreateDto }) => { return data; }; + const updateSurvey = async ({ surveyId, body, @@ -323,7 +324,7 @@ const updateSurvey = async ({ surveyId?: string; body: DocSurveyUpdateDto; }) => { - const response = await fetch(`${DOC_SURVEY_URL}/responses/${surveyId}`, { + const response = await fetch(`${DOC_SURVEY_URL}?surveyId=${surveyId}`, { method: "PATCH", headers: { "Content-Type": "application/json",