diff --git a/packages/ra-core/src/controller/saveContext/SaveContext.ts b/packages/ra-core/src/controller/saveContext/SaveContext.ts index 8b9797de353..c33221ba9a6 100644 --- a/packages/ra-core/src/controller/saveContext/SaveContext.ts +++ b/packages/ra-core/src/controller/saveContext/SaveContext.ts @@ -1,7 +1,7 @@ import { createContext } from 'react'; import { RaRecord, - onError, + OnError, OnSuccess, TransformData, MutationMode, @@ -23,7 +23,7 @@ export type SaveHandler = ( record: Partial, callbacks?: { onSuccess?: OnSuccess; - onError?: onError; + onError?: OnError; transform?: TransformData; } ) => Promise | Record; diff --git a/packages/ra-core/src/types.ts b/packages/ra-core/src/types.ts index be2bcbe9dae..3b210fee4d6 100644 --- a/packages/ra-core/src/types.ts +++ b/packages/ra-core/src/types.ts @@ -247,7 +247,11 @@ export type OnSuccess = ( variables?: any, context?: any ) => void; -export type onError = (error?: any, variables?: any, context?: any) => void; + +// @deprecated - use OnError instead +export type OnError = (error?: any, variables?: any, context?: any) => void; +export type onError = OnError; + export type TransformData = ( data: any, options?: { previousData: any }