Skip to content

Commit 97481d6

Browse files
committed
Use call time meta when provided
1 parent 19cec73 commit 97481d6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/ra-core/src/dataProvider/useUpdate.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export const useUpdate = <RecordType extends RaRecord = any, ErrorType = Error>(
115115
// otherwise the other side effects may not applied.
116116
const hasCallTimeOnSuccess = useRef(false);
117117

118-
const updateCache = ({ resource, id, data }) => {
118+
const updateCache = ({ resource, id, data, meta }) => {
119119
// hack: only way to tell react-query not to fetch this query for the next 5 seconds
120120
// because setQueryData doesn't accept a stale time option
121121
const now = Date.now();
@@ -273,6 +273,7 @@ export const useUpdate = <RecordType extends RaRecord = any, ErrorType = Error>(
273273
resource: callTimeResource,
274274
id: callTimeId,
275275
data,
276+
meta: mutationOptions.meta ?? paramsRef.current.meta,
276277
});
277278

278279
if (
@@ -440,6 +441,7 @@ export const useUpdate = <RecordType extends RaRecord = any, ErrorType = Error>(
440441
resource: callTimeResource,
441442
id: callTimeId,
442443
data: callTimeData,
444+
meta: callTimeMeta,
443445
});
444446

445447
// run the success callbacks during the next tick

0 commit comments

Comments
 (0)