-
Notifications
You must be signed in to change notification settings - Fork 430
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: use discard in delete action when document is not published #6535
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
return vXClient.observable.request({ | ||
url: `/data/actions/${dataset}`, | ||
method: 'post', | ||
tag: 'document.delete', |
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've maintained the tag as document.delete
so we have a sense of what the user's intent was. We can change it to document.discard
if we don't like this choice.
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 don't see a problem with changing this to "document.discard", The fact that the button says "Delete" in this case feels more coincidental, and you could argue that it might as well say "Discard draft" when there is no published document.
No changes to documentation |
Component Testing Report Updated May 6, 2024 10:13 PM (UTC)
|
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.
Nice work - thanks for adding tests ✨
7c7c8a8
to
fc45d71
Compare
Description
The
delete
action in server side document actions requires a published document. In those cases when there is not a published document, we can't use this endpoint.This PR adds logic for those cases by using the discard endpoint instead, and adds a few tests.
What to review
That the logic makes sense and this is how we want to proceed. We can always work with other teams to ensure we're doing something semantic that won't hinder us later.
Testing
This PR adds two tests for the delete action.