Skip to content

Commit

Permalink
Stringify JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminEHowe committed Jun 19, 2024
1 parent 1062e07 commit aa67063
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion functions-src/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ async function handleForm({
}

await context.env.DB_FORMS.prepare("INSERT INTO submissions (submission_id, form_id, submitted_ts, reply_email, fields, spam_reasons, cf, headers) VALUES (?, ?, ?, ?, ?, ?, ?, ?)")
.bind(submissionId, formId, submittedTs, replyEmail, fields, spamReasons, cf, headers)
.bind(
submissionId,
formId,
submittedTs,
replyEmail,
JSON.stringify(fields),
JSON.stringify(spamReasons),
JSON.stringify(cf),
JSON.stringify(headers)),
.run();

if (spamReasons.length === 0) {
Expand Down

0 comments on commit aa67063

Please sign in to comment.