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

Show mutation error on snapshot-to-image form #1779

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

david-crespo
Copy link
Collaborator

Closes #1778

Trivial fix. Turns out we can easily make submitError a required prop and prevent this in future. In placeholder forms where we don't have a mutation (image edit and IdP edit) we can just pass null.

@vercel
Copy link

vercel bot commented Oct 9, 2023

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

Name Status Preview Updated (UTC)
console ✅ Ready (Inspect) Visit Preview Oct 9, 2023 3:23am

@david-crespo david-crespo enabled auto-merge (squash) October 9, 2023 03:23
@@ -78,6 +78,7 @@ export function CreateImageFromSnapshotSideModalForm() {
body: { ...body, source: { type: 'snapshot', id: data.id } },
})
}
submitError={createImage.error}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the fix

@@ -29,7 +29,7 @@ type SideModalFormProps<TFieldValues extends FieldValues> = {
/** Must be provided with a reason describing why it's disabled */
submitDisabled?: string
/** Error from the API call */
submitError?: ApiError | null
submitError: ApiError | null
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the Mistake Preventer

@david-crespo david-crespo merged commit a68c7c8 into main Oct 9, 2023
@david-crespo david-crespo deleted the snapshot-to-image-error branch October 9, 2023 03:38
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.

Already exists error on image create not displayed
1 participant