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

[TypeScript] Fix cannot specify the error type in mutation hooks #7698

Merged
merged 2 commits into from
May 19, 2022

Conversation

soullivaneuh
Copy link
Contributor

Provides a way to set the expected type of the error instance that will be propagated to the related functions.

closes #7653

Copy link
Contributor

@djhi djhi left a comment

Choose a reason for hiding this comment

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

Thanks!

@djhi djhi added this to the 4.0.5 milestone May 17, 2022
Copy link
Contributor

@slax57 slax57 left a comment

Choose a reason for hiding this comment

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

Otherwise that's a great contribution, thanks! 🙂

docs/useUpdateMany.md Outdated Show resolved Hide resolved
@soullivaneuh
Copy link
Contributor Author

I did the requested changes and cleaned up the commit history. 👍

Copy link
Contributor

@slax57 slax57 left a comment

Choose a reason for hiding this comment

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

Code seems fine to me, thanks again! 👍
Vercel deployment is failing though, but I don't know why. Storybook and simple example both run fine on my machine. It's probably a permissions problem...
I'll merge as soon as I have confirmation by the rest of the team 🙂

@slax57
Copy link
Contributor

slax57 commented May 19, 2022

Apparently Vercel complains because the yarn.lock file is not up to date.
Could you run yarn in the root folder and commit the resulting yarn.lock?
This should be enough to fix the deployment steps 🙂

@fzaninotto
Copy link
Member

or try to rebase on master

@fzaninotto fzaninotto removed this from the 4.0.5 milestone May 19, 2022
@soullivaneuh soullivaneuh force-pushed the feat/use-mutation-error-typing branch from 282e859 to 29cf058 Compare May 19, 2022 13:13
@soullivaneuh
Copy link
Contributor Author

soullivaneuh commented May 19, 2022

@slax57 @fzaninotto The rebase is done!

EDIT: I failed it. Will rework that.

@vercel vercel bot temporarily deployed to Preview – react-admin May 19, 2022 13:15 Inactive
@soullivaneuh soullivaneuh force-pushed the feat/use-mutation-error-typing branch 2 times, most recently from 282e859 to ada9ed4 Compare May 19, 2022 13:22
@vercel vercel bot temporarily deployed to Preview – react-admin May 19, 2022 13:24 Inactive
@soullivaneuh soullivaneuh force-pushed the feat/use-mutation-error-typing branch from ada9ed4 to 7746921 Compare May 19, 2022 13:25
@vercel vercel bot temporarily deployed to Preview – react-admin May 19, 2022 13:26 Inactive
@soullivaneuh
Copy link
Contributor Author

@slax57 Should be OK now! 👍

@slax57
Copy link
Contributor

slax57 commented May 19, 2022

Unit tests are failing, but this is unrelated to your PR. We have this on master too (consequence of merging 4.0.5 and 4.1.0 together it seems).
Anyway, your PR is fine, I'll just wait for master to be fixed, to ensure your PR passes all checks before merging. 🤞

@soullivaneuh soullivaneuh force-pushed the feat/use-mutation-error-typing branch from 7746921 to 853d90d Compare May 19, 2022 14:31
@soullivaneuh
Copy link
Contributor Author

soullivaneuh commented May 19, 2022

@slax57 I saw your team merged some test fix on master, so I did a new rebase.

@vercel vercel bot temporarily deployed to Preview – react-admin May 19, 2022 14:32 Inactive
@slax57 slax57 added this to the 4.1.1 milestone May 19, 2022
@slax57 slax57 merged commit a85d306 into marmelab:master May 19, 2022
@soullivaneuh soullivaneuh deleted the feat/use-mutation-error-typing branch May 19, 2022 15:49
@fzaninotto fzaninotto changed the title feat(hooks): mutation error typing [TypeScript] Fix cannot specify the error type in mutation hooks May 19, 2022
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.

hooks: useUpdate onError signature typescript issue
4 participants