Describe the bug
The useForm hook passes queryOptions to useOne like this:
enabled: !isCreate && id !== undefined,
...props.queryOptions,
This results in the internal enabled condition (!isCreate && id !== undefined) being overridden if the user passes a custom enabled flag through queryOptions.
As a result, if the custom enabled is set to true but id is still undefined, the hook proceeds to make an API call with an invalid or missing ID — leading to unintended behavior, Or atleast doesnt look obvious behaviour.
Steps To Reproduce
pass enabled to useForm like this
useForm({
queryOptions: {
enabled: <my condition>
}
})
Expected behavior
I would expect that it performs ANDing of my condition and the existing condition, since no one would never expect it to take id as undefined.
Packages
Additional Context
No response
Describe the bug
The useForm hook passes queryOptions to useOne like this:
enabled: !isCreate && id !== undefined,
...props.queryOptions,
This results in the internal enabled condition (!isCreate && id !== undefined) being overridden if the user passes a custom enabled flag through queryOptions.
As a result, if the custom enabled is set to true but id is still undefined, the hook proceeds to make an API call with an invalid or missing ID — leading to unintended behavior, Or atleast doesnt look obvious behaviour.
Steps To Reproduce
pass enabled to useForm like this
Expected behavior
I would expect that it performs ANDing of my condition and the existing condition, since no one would never expect it to take id as undefined.
Packages
Additional Context
No response