-
Notifications
You must be signed in to change notification settings - Fork 440
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
fix(sanity): editing version document using Actions API #8302
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
No changes to documentation |
Component Testing Report Updated Jan 17, 2025 12:30 AM (UTC) ❌ Failed Tests (2) -- expand for details
|
⚡️ Editor Performance ReportUpdated Fri, 17 Jan 2025 00:31:21 GMT
Detailed information🏠 Reference resultThe performance result of
🧪 Experiment resultThe performance result of this branch
📚 Glossary
|
At this point in time, the Actions API can only execute certain actions for version documents (e.g. `sanity.action.document.edit`) in `vX`.
03d5d47
to
be0e70b
Compare
be0e70b
to
03ef886
Compare
When using the Actions API to edit a version document, the `draftId` option must refer to the version id. Previously, the draft document would be patched instead, which is incorrect.
03ef886
to
c1804ef
Compare
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.
Tested it and it looks good to me, thanks for working this out @juice49 !
Great work!
Description
This branch fixes version editing when using the Actions API, and enables the Actions API in the default workspace in Test Studio.
When using the Actions API to edit a version document, the
draftId
option must refer to the version id. Previously, the draft document would be patched instead, which is incorrect.This branch also temporarily changes the API version to
vX
when executing Actions API actions. At this point in time, the Actions API can only execute certain actions for version documents (e.g.sanity.action.document.edit
) invX
.What to review
Editing a version document successfully calls the edit action for the version document. The draft and published documents must not be affected.
Testing
Added unit test in
packages/sanity/src/core/store/_legacy/document/document-pair/serverOperations/patch.test.ts
.