Skip to content

Commit 2efc7cc

Browse files
committed
accept 0 as valid id in useCreate updateCache
1 parent ddb1709 commit 2efc7cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export const useCreate = <
146146
mutationMode === 'pessimistic'
147147
? result?.id
148148
: params.data?.id;
149-
if (!id) {
149+
if (id === undefined || id === null) {
150150
throw new Error(
151151
'Invalid dataProvider response for create: missing id'
152152
);

0 commit comments

Comments
 (0)