We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0cc5ee5 commit 54490c7Copy full SHA for 54490c7
functions/submission-created.js
@@ -1,4 +1,5 @@
1
const sanityClient = require('@sanity/client')
2
+const { uuid } = require('@sanity/uuid')
3
const client = sanityClient({
4
projectId: 'zv292tg5',
5
dataset: 'production',
@@ -7,7 +8,9 @@ const client = sanityClient({
7
8
9
exports.handler = async function (event, context, callback) {
10
const { payload } = JSON.parse(event.body)
- const result = await client.create({ _type: 'submission.form', ...payload })
11
+ const result = await client.create({
12
+ _id: `submission.${uuid()}`
13
+ _type: 'submission.form', ...payload })
14
callback(null, {
15
statusCode: 200
16
})
0 commit comments