You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
consttransaction=newsanityClient.Transaction()transaction.delete({query: '*[_type == "apartment"]'})//... other operationsaccountClient.mutate(transaction)
Error: delete(): "[object Object]" is not a valid document ID
at Object.exports.validateDocumentId (node_modules/@sanity/client/lib/validators.js:42:11)
at Transaction._delete [as delete] (node_modules/@sanity/client/lib/data/transaction.js:47:16)
at Object.importApartmentsTo (/app/netlify/src/provider/accounts.js:45:29)
at module.exports (app/netlify/src/usecase/handleSingleAccountImport.js:11:18)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.exports.handler (app/netlify/functions/fetch-account.js:19:5)
According to the documentation (https://www.sanity.io/docs/http-mutations#d8ebd1878516l) one should be able to pass a query to delete inside a transaction:
But doing the following gives an error:
node_modules/@sanity/client/lib/data/transaction.js:46:
I'm using @sanity/client 3.4.1.
is there a way to work around it?
The text was updated successfully, but these errors were encountered: