fix: formbricks docs survey endpoint (#1901)

This commit is contained in:
Shubham Palriwala
2024-01-16 12:44:58 +05:30
committed by GitHub
parent f4a31ad563
commit be4534da2d

View File

@@ -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: {