-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
[RFR] Trigger refresh after crudUpdate #3506
Conversation
@@ -12,7 +13,8 @@ export const crudUpdate = ( | |||
data: any, | |||
previousData: any, | |||
basePath: string, | |||
redirectTo: RedirectionSideEffect = 'show' | |||
redirectTo: RedirectionSideEffect = 'show', | |||
refresh: RefreshSideEffect = true |
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.
Do we need a refresh if we have a redirect ? I think the default value should be false
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.
same as with delete, with undoable false and redirect to same page, we need refresh to happen if no redirect
fixes the same thing as #2425 but for update
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.
If you choose to disable optimistic updates and to redirect to the same page, isn't it your responsability to set the refresh to true
? This will trigger a refresh and a redirection for all default cases
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'm surprised it was accepted on delete btw
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.
but you cannot set refresh true using provided props,
the only workaround is to create new redux action and set it there
but many ppl will not even know about it, cause they would think that refresh happens like it does if its undoable (with undoable it works with the redirect on same page) its just this one edge case that behaves differently
and same for delete where same fix was applied
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'll consider this a workaround until v3 is out then
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.
this "workaround" is already in next branch for delete
refresh: RefreshSideEffect = true |
so this one should probably be put to next too as the same bug exists in next too
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.
We'll probably won't need them anymore soon
related to #2425
superseed's #2823