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(sanity): use actions API when deleting documents #6115
feat(sanity): use actions API when deleting documents #6115
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
No changes to documentation |
Component Testing Report Updated Apr 8, 2024 1:20 PM (UTC)
|
Note: still work in progress, pending backend support for `skipCrossDatasetReferenceValidation`
c5d4173
to
7a8e0be
Compare
|
||
if (isLiveEditEnabled(schema, typeName)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice that the delete action includes the drafts.live-edited-document-id
when we execute a delete on a live-edited document.
The backend doesn't seem particularly bothered by this -- it includes a "mutations" array in its response payload that has just the live edited document ID, but is it something we should avoid sending?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I think it doesn't matter that much, and might even be preferable.
There's actually also a slight benefit - if you go from "liveEdit: false" to "liveEdit: true" while having a draft, the existing draft will still be floating around, which can cause trouble later on. Now that delete will also include deleting the draft, there's now actually a workaround (although veeery sketchy) in that you can hit delete on the document and then restore it later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, TIL! also interesting to consider as this API develops and we use it for other purposes.
with that in mind, IMO this is good to go :)
* feat(sanity): use actions API when deleting documents * fix(sanity): add skipCrossDatasetReferenceValidation to delete action
* feat(sanity): use actions API when deleting documents * fix(sanity): add skipCrossDatasetReferenceValidation to delete action
* feat(sanity): use actions API when deleting documents * fix(sanity): add skipCrossDatasetReferenceValidation to delete action
* feat(sanity): use actions API when deleting documents * fix(sanity): add skipCrossDatasetReferenceValidation to delete action
* feat(sanity): use actions API when deleting documents * fix(sanity): add skipCrossDatasetReferenceValidation to delete action
* feat(sanity): use actions API when deleting documents * fix(sanity): add skipCrossDatasetReferenceValidation to delete action
* feat(sanity): use actions API when deleting documents * fix(sanity): add skipCrossDatasetReferenceValidation to delete action
* feat(sanity): use actions API when deleting documents * fix(sanity): add skipCrossDatasetReferenceValidation to delete action
* test(structure): add document title test id * test(structure): document panel displays correct title for published document * feat(sanity): use actions API when publishing documents * feat(sanity): use Actions API when unpublishing documents (#6094) * feat(sanity): use Actions API when unpublishing documents * feat(core): set `skipCrossDatasetReferenceValidation` parameter when unpublishing documents * feat(sanity): use actions API when deleting documents (#6115) * feat(sanity): use actions API when deleting documents * fix(sanity): add skipCrossDatasetReferenceValidation to delete action --------- Co-authored-by: Bjørge Næss <bjoerge@gmail.com>
This should be good to go now