TanStackT
TanStack12mo ago
3 replies
uncertain-scarlet

Issue in post data with mutate

i have an issue with posting data using mutate

in this i set the api response 200 ok for success and 400 bad request for failure

when the handle create button click it call the api when is api response is 400 it send the input validation response given in the image

in this case i use this response as error text for the input box

the issue is when this error occurs, the state is set to true in actual case , in my case the state is updated only after some times and it execute the else part of handle next button click and it always show success if an error occurs how to solve this
image.png
image-1.png
image-2.png
image-3.png
image-4.png
Was this page helpful?