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

[RFR] Trigger refresh after crudUpdate #3506

Merged
merged 1 commit into from
Aug 12, 2019
Merged

[RFR] Trigger refresh after crudUpdate #3506

merged 1 commit into from
Aug 12, 2019

Conversation

natrim
Copy link
Contributor

@natrim natrim commented Aug 10, 2019

related to #2425
superseed's #2823

@natrim natrim changed the title Trigger refresh after crudUpdate [RFR] Trigger refresh after crudUpdate Aug 10, 2019
@@ -12,7 +13,8 @@ export const crudUpdate = (
data: any,
previousData: any,
basePath: string,
redirectTo: RedirectionSideEffect = 'show'
redirectTo: RedirectionSideEffect = 'show',
refresh: RefreshSideEffect = true
Copy link
Collaborator

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

Copy link
Contributor Author

@natrim natrim Aug 12, 2019

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

Copy link
Collaborator

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

Copy link
Collaborator

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

Copy link
Contributor Author

@natrim natrim Aug 12, 2019

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

Copy link
Collaborator

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

Copy link
Contributor Author

@natrim natrim Aug 12, 2019

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

so this one should probably be put to next too as the same bug exists in next too

Copy link
Collaborator

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

@djhi djhi merged commit cdae06f into marmelab:master Aug 12, 2019
@fzaninotto fzaninotto added this to the 2.9.6 milestone Aug 21, 2019
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.

3 participants