#I don't see my deleted collection appear in the trash bin

7 messages · Page 1 of 1 (latest)

pale lantern
#

I have a collection with trash: true enabled. I'm on version 3.77.0. When I use

await payload.delete({
collection: 'my-collection',
id: 1,
user,
overrideAccess: false
}), 

The document gets deleted, but it's permanently deleted. Am I missing something that prevents it from being soft deleted first?

smoky tuskBOT
white reef
#

This is a great question!

payload.delete() always permanently deletes — it never soft-deletes, even on collections with trash: true

#

The trash: true collection config enables the feature, but the actual soft-delete is done via update, not delete

#

so something like...

  collection: 'my-collection',
  id: 1,
  data: { deletedAt: new Date().toISOString() },
  overrideAccess: false,
  user,
})```
pale lantern
#

That does the trick! Thanks for your help 🙂

white reef
#

Of course!