Hi!
Using Strapi 4.20
, Im deleting media attached to a collection type before deleting the collection type itself.
Im using the beforeDelete
lifecycle hook and in there I have the following piece of code:
await strapi.db.query('plugin::upload.file').delete({ where: { id: fileId } })
.then((res) => {
console.log('Deleted the collo label!')
})
This removes the file perfectly in Strapi, but the image/media remains in the AWS bucket, this seems like a bug to me?
Is this the right way to do it?