Files
openpanel/packages/core/src/interfaces/successErrorNotification.ts
Stefan Pejcic 8595a9f4e5 back
2024-05-08 19:58:53 +02:00

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);
};