Closed
Description
Hi,
On multiple places, since I've updated our package the mutation is stuck on 'Pending' even when an error is thrown.
See screenshot and code below.
The server returns 422, but the mutation doesn't get rejected.
It works with fulfilled mutation, but not rejected ones.
I have the issue in multiple places in my codebase and had to revert back to handling the state manually.
Any clues?
Thank you!
// Mutation
verifyEmail: builder.mutation({
query: ({ key, email }) => ({
url: `membership/validate-email/${key}/${email}`,
method: "PUT",
}),
// In my component
const [
verifyEmailMutation,
{ isLoading, isError, isSuccess, isUninitialized },
] = useVerifyEmailMutation();
<button onClick={() => { isUninitialized && verifyEmailMutation({ key, email }); } > Button </button>