Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: discard drafts when enabling draft and publish on ct #20257

Merged
merged 2 commits into from May 6, 2024

Conversation

Marc-Roig
Copy link
Contributor

@Marc-Roig Marc-Roig commented May 3, 2024

What does it do?

On V5, content types without draft and publish have a single version , where the publishedAt value is filled with a date.
Content Types with draft and publish have two versions, a draft and a published version, where the publishedAt value is null on drafts and filled with a date on published versions.

When enabling draft and publish on a content type, we were copying the single version with the publishedAt value filled and updating the publishedAt value to be null.

This process did not copy components or relations, and now all documents are processed in batch, to call the documents.discardmethod, which takes care of that, at the cost of processing one version at a time.

Copy link

vercel bot commented May 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
contributor-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 3, 2024 10:26am

Copy link
Member

@alexandrebodin alexandrebodin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic seems fine, didn't QA

@Marc-Roig
Copy link
Contributor Author

Will ask marion to include QA in a blitz session

@Marc-Roig Marc-Roig merged commit 01187db into v5/main May 6, 2024
79 of 83 checks passed
@Marc-Roig Marc-Roig deleted the v5/enable-dp-discard-drafts branch May 6, 2024 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants