score:1

Accepted answer
const onSubmit = (formData: FormData) => {
  document.body.style.cursor = 'wait';
  axios.post('/api/create_customer', {
    email: 'testemail@test.com',
    name: `Dario Kolic`,
  }).then((customer) => {
    setCustomerId(customer.data);
    auth
      .createUserWithEmailAndPassword(formData.email, formData.password)
      .then(() => {
        return new UserDataProvider().set({
          customerId: customer.data,
        });
      })
      .then(() => {
        document.body.style.cursor = 'default';
        // window.location.href = '/terms_of_service';
      });
  })
};

Related Query

More Query from same tag