title: How do I get the HTTP response code from a successful React query?
body: <p>How do I get the status code from a successful React query?</p>
  <p>This is my custom hook:</p>
  <pre><code>const validateIban = async (accountId, encodedIban) =&gt; {
      await axios
          .post(`${CUSTOMER_PORTAL_API}/policy/accounts/${accountId}/iban/${encodedIban}`)
  };
  
  export function useValidateIban(accountId) {
      return useMutation(encodedIban =&gt; validateIban(accountId, encodedIban));
  }
  </code></pre>
  <p>And this is where I use the hook with mutate:</p>
  <pre><code>const validateIbanQuery = useValidateIban(accountId)
  
  
  validateIbanQuery.mutate(encodeURIComponent(iban), {
          onSuccess: () =&gt; {
            ******HERE I WANT THE STATUS CODE (204, 202 e.g.)******
          },
          onError: (error) =&gt; {
            if (error.response.status === 400) {
              ....
            }
            if (error.response.status === 403) {
              ....
            }
          }
        })
  </code></pre>