From 2c777860c2431f6a10f32278dcfdd803d90f6318 Mon Sep 17 00:00:00 2001 From: Gildas Garcia <1122076+djhi@users.noreply.github.com> Date: Fri, 5 Jul 2024 17:03:46 +0200 Subject: [PATCH] Update mutations results types to include `isLoading` --- packages/ra-core/src/dataProvider/useCreate.ts | 2 +- packages/ra-core/src/dataProvider/useDelete.ts | 2 +- packages/ra-core/src/dataProvider/useDeleteMany.ts | 2 +- packages/ra-core/src/dataProvider/useUpdate.ts | 2 +- .../ra-core/src/dataProvider/useUpdate.undoable.stories.tsx | 1 + packages/ra-core/src/dataProvider/useUpdateMany.ts | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/ra-core/src/dataProvider/useCreate.ts b/packages/ra-core/src/dataProvider/useCreate.ts index 271b2953cde..b84995cfe89 100644 --- a/packages/ra-core/src/dataProvider/useCreate.ts +++ b/packages/ra-core/src/dataProvider/useCreate.ts @@ -268,5 +268,5 @@ export type UseCreateResult< MutationError, Partial>, unknown - >, + > & { isLoading: boolean }, ]; diff --git a/packages/ra-core/src/dataProvider/useDelete.ts b/packages/ra-core/src/dataProvider/useDelete.ts index a2b48126aff..fa618bb57db 100644 --- a/packages/ra-core/src/dataProvider/useDelete.ts +++ b/packages/ra-core/src/dataProvider/useDelete.ts @@ -490,5 +490,5 @@ export type UseDeleteResult< MutationError, Partial & { resource?: string }>, unknown - >, + > & { isLoading: boolean }, ]; diff --git a/packages/ra-core/src/dataProvider/useDeleteMany.ts b/packages/ra-core/src/dataProvider/useDeleteMany.ts index 9736d6486d7..3da0a889752 100644 --- a/packages/ra-core/src/dataProvider/useDeleteMany.ts +++ b/packages/ra-core/src/dataProvider/useDeleteMany.ts @@ -504,5 +504,5 @@ export type UseDeleteManyResult< MutationError, Partial & { resource?: string }>, unknown - >, + > & { isLoading: boolean }, ]; diff --git a/packages/ra-core/src/dataProvider/useUpdate.ts b/packages/ra-core/src/dataProvider/useUpdate.ts index cf5b79c34da..05c33fac20f 100644 --- a/packages/ra-core/src/dataProvider/useUpdate.ts +++ b/packages/ra-core/src/dataProvider/useUpdate.ts @@ -551,5 +551,5 @@ export type UseUpdateResult< ErrorType, Partial & { resource?: string }>, unknown - >, + > & { isLoading: boolean }, ]; diff --git a/packages/ra-core/src/dataProvider/useUpdate.undoable.stories.tsx b/packages/ra-core/src/dataProvider/useUpdate.undoable.stories.tsx index c6e72089ad3..9d8f0204751 100644 --- a/packages/ra-core/src/dataProvider/useUpdate.undoable.stories.tsx +++ b/packages/ra-core/src/dataProvider/useUpdate.undoable.stories.tsx @@ -59,6 +59,7 @@ const SuccessCore = () => { ); setNotification(true); }; + return ( <>
diff --git a/packages/ra-core/src/dataProvider/useUpdateMany.ts b/packages/ra-core/src/dataProvider/useUpdateMany.ts index a24df0df065..f69a6dbab98 100644 --- a/packages/ra-core/src/dataProvider/useUpdateMany.ts +++ b/packages/ra-core/src/dataProvider/useUpdateMany.ts @@ -523,5 +523,5 @@ export type UseUpdateManyResult< MutationError, Partial> & { resource?: string }>, unknown - >, + > & { isLoading: boolean }, ];