mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { OpenNotificationParams } from ".";
|
|
|
|
export type SuccessErrorNotification<
|
|
TData = unknown,
|
|
TError = unknown,
|
|
TVariables = unknown,
|
|
> = {
|
|
/**
|
|
* Success notification configuration to be displayed when the mutation is successful.
|
|
* @default '"There was an error creating resource (status code: `statusCode`)" or "Error when updating resource (status code: statusCode)"'
|
|
|
|
*/
|
|
successNotification?:
|
|
| OpenNotificationParams
|
|
| false
|
|
| ((
|
|
data?: TData,
|
|
values?: TVariables,
|
|
resource?: string,
|
|
) => OpenNotificationParams | false);
|
|
/**
|
|
* 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)"'
|
|
*/
|
|
errorNotification?:
|
|
| OpenNotificationParams
|
|
| false
|
|
| ((
|
|
error?: TError,
|
|
values?: TVariables,
|
|
resource?: string,
|
|
) => OpenNotificationParams | false);
|
|
};
|