homeflowjs 1.0.24 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -65,7 +65,14 @@ export const createUser = (payload) => (dispatch, getState) => {
65
65
  authenticity_token: authenticityToken,
66
66
  }),
67
67
  })
68
- .then((response) => response.json())
68
+ .then(async (response) => {
69
+ const response_status = response.status;
70
+ const json = await response.json();
71
+
72
+ if (response_status === 422) throw json?.errors
73
+
74
+ return json
75
+ })
69
76
  .then(() => {
70
77
  // load saved properties and searches from localStorage
71
78
  const serializedSavedProperties = localStorage.getItem('savedProperties');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homeflowjs",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "sideEffects": [
5
5
  "modal/**/*",
6
6
  "user/default-profile/**/*",
@@ -51,9 +51,12 @@ const UserRegisterForm = (props) => {
51
51
  window.location.hash = redirectHash;
52
52
  }
53
53
  })
54
- .catch(() => {
54
+ .catch((errors) => {
55
55
  if (userParams?.body) {
56
56
  window.location.href = '/';
57
+ } else if(errors?.password){
58
+ // this could be used for any kind of errors but we only need it for password errors right now
59
+ errors.password.forEach((error) => notify(error, 'error', { duration: 8000 }))
57
60
  } else {
58
61
  notify(
59
62
  'Sorry, something went wrong. You may already have an account with this email address, if so, please try signing in instead of registering.',