mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-08 23:00:48 -06:00
22 lines
581 B
TypeScript
22 lines
581 B
TypeScript
export const addResponseNote = async (
|
|
environmentId: string,
|
|
surveyId: string,
|
|
responseId: string,
|
|
text: string
|
|
) => {
|
|
try {
|
|
const res = await fetch(
|
|
`/api/v1/environments/${environmentId}/surveys/${surveyId}/responses/${responseId}/responsesNotes`,
|
|
{
|
|
method: "POST",
|
|
headers: { "Content-Type": "application/json" },
|
|
body: JSON.stringify(text),
|
|
}
|
|
);
|
|
return await res.json();
|
|
} catch (error) {
|
|
console.error(error);
|
|
throw Error(`createResponseNote: unable to create responseNote: ${error.message}`);
|
|
}
|
|
};
|