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

Fix redirectTo returned by useEditController #8243

Merged
merged 2 commits into from
Oct 7, 2022
Merged

Conversation

WiXSL
Copy link
Contributor

@WiXSL WiXSL commented Oct 6, 2022

useEditController should return the redirectTo used to redirect (if any) or the default, just like useCreateController does it, not the default

@WiXSL WiXSL added the RFR Ready For Review label Oct 6, 2022
@fzaninotto
Copy link
Member

I'm not sure what bug this fixes. Could you please add a unit test?

@WiXSL
Copy link
Contributor Author

WiXSL commented Oct 6, 2022

If you want to use the redirect from useEditContext later on, it should match the redirect passed to the controller

@slax57
Copy link
Contributor

slax57 commented Oct 7, 2022

Seems good to me! I'll just wait on François' approval before merging

@@ -220,7 +220,7 @@ export const useEditController = <
isLoading,
mutationMode,
record,
redirect: DefaultRedirect,
redirect: redirectTo,
Copy link
Member

Choose a reason for hiding this comment

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

This context variable isn't used anywhere in our code - I think it's a leftover from v3. I'll validate the PR, but I think we should ultimately mark it as deprecated.

@fzaninotto fzaninotto merged commit f402f68 into master Oct 7, 2022
@fzaninotto fzaninotto deleted the fix-redirectto-edit branch October 7, 2022 14:52
@fzaninotto fzaninotto added this to the 4.4.1 milestone Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants