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(core): added undefined type successNotification and errorNotification #6327

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/blue-dingos-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@refinedev/core": patch
---

fix(core): added ability to return `undefined` to fallback to the default notification config when using the function form in `successNotification` and `errorNotification` props.

[Resolves #6270](https://github.com/refinedev/refine/issues/6270)
4 changes: 2 additions & 2 deletions packages/core/src/contexts/notification/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type SuccessErrorNotification<
data?: TData,
values?: TVariables,
resource?: string,
) => OpenNotificationParams | false);
) => OpenNotificationParams | false | undefined);
/**
* Error notification configuration to be displayed when the mutation fails.
* @default '"There was an error creating resource (status code: `statusCode`)" or "Error when updating resource (status code: statusCode)"'
Expand All @@ -27,7 +27,7 @@ export type SuccessErrorNotification<
error?: TError,
values?: TVariables,
resource?: string,
) => OpenNotificationParams | false);
) => OpenNotificationParams | false | undefined);
};

export type OpenNotificationParams = {
Expand Down
Loading