From be4534da2d8d7bd197a40a87fc9d32ed2bf06fac Mon Sep 17 00:00:00 2001 From: Shubham Palriwala Date: Tue, 16 Jan 2024 12:44:58 +0530 Subject: [PATCH] fix: formbricks docs survey endpoint (#1901) --- apps/formbricks-com/lib/handleFeedbackSubmit.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/formbricks-com/lib/handleFeedbackSubmit.ts b/apps/formbricks-com/lib/handleFeedbackSubmit.ts index 537bd20a8f..2561ce21ff 100644 --- a/apps/formbricks-com/lib/handleFeedbackSubmit.ts +++ b/apps/formbricks-com/lib/handleFeedbackSubmit.ts @@ -1,19 +1,18 @@ export const handleFeedbackSubmit = async (YesNo: string, pageUrl: string | null) => { const response_data = { - data: { - isHelpful: YesNo, - pageUrl: pageUrl, - }, + isHelpful: YesNo, + pageUrl: pageUrl, }; const payload = { - response: response_data, surveyId: process.env.NEXT_PUBLIC_FORMBRICKS_COM_DOCS_FEEDBACK_SURVEY_ID, + finished: true, + data: response_data, }; try { const res = await fetch( - `${process.env.NEXT_PUBLIC_FORMBRICKS_COM_API_HOST}/api/v1/client/environments/${process.env.NEXT_PUBLIC_FORMBRICKS_COM_ENVIRONMENT_ID}/responses`, + `${process.env.NEXT_PUBLIC_FORMBRICKS_COM_API_HOST}/api/v1/client/${process.env.NEXT_PUBLIC_FORMBRICKS_COM_ENVIRONMENT_ID}/responses`, { method: "POST", headers: {