Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit a262998

Browse files
committed
ensure rating does not cause a schema error
1 parent fa9ff81 commit a262998

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/guides/nodejs/survey-website.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ const SurveyForm = () => {
100100
const response = await fetch('/api/forms/forms/feedback', {
101101
method: 'POST',
102102
headers: { 'Content-Type': 'application/json' },
103-
body: JSON.stringify(formData),
103+
body: JSON.stringify({
104+
...formData,
105+
// ensure rating is a number
106+
rating: Number(formData.rating),
107+
}),
104108
})
105109
106110
if (!response.ok) throw new Error('Failed to submit')

0 commit comments

Comments
 (0)