contentful-management.rb
contentful-management.rb copied to clipboard
Entry destroy not working as expected
Unpublish & archive working but destroy results in this error FrozenError (can't modify frozen String: ""). Tried unpublishing and/or archiving first, but destroy still failed. Is there some other config or process to destroy entries?
module ContentfulAdapter
module Management
module DeleteEntries
module_function
def delete_all(entry_type:)
cms_client = ContentfulAdapter::Management::CreateClient.call
space = cms_client.spaces.find(ENV['CONTENTFUL_SPACE'])
entries = space.entries.all(content_type: entry_type)
entries.each do |entry|
entry.unpublish
entry.destroy
end
end
end
end
end
Hey @crowdcow-shae, thanks for reporting the issue.
I am looking into it. I will get back to you if I need more details.
Cheers