-
Notifications
You must be signed in to change notification settings - Fork 14
Conversation
@xx-db I'm tagging you in a comment in hopes that it lets me add you as a reviewer 🙏 |
} | ||
|
||
export function useDeleteSchema({ | ||
onSuccessCallback, |
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.
Sorry I just captured this.
You don't need to do create a new prop here to handle on success.
You can just simply do onSuccess in the caller
mutation.mutate(values, {
onSuccess: () => {}
});
Can we have follow-up PRs to remove this pattern on other deletion hooks?
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 you mean to move the invalidateQueries
to the caller as well?
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.
Nope, keep invalidateQueries
in the mutation hook.
It would works for both 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.
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.
Ok got it, but we don't need to pass in onSuccessCallback
. I will do a follow-on PR to remove all those. Thanks @yc-shawn 👍
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.
lgtm 💪
* delete schema functionality * prettier
* delete schema functionality * prettier
* delete schema functionality * prettier
Screen.Recording.2024-08-07.at.2.59.45.PM.mov
Closes #36