homeflowjs 1.0.23 → 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.
package/actions/user.actions.js
CHANGED
@@ -65,7 +65,14 @@ export const createUser = (payload) => (dispatch, getState) => {
|
|
65
65
|
authenticity_token: authenticityToken,
|
66
66
|
}),
|
67
67
|
})
|
68
|
-
.then((response) =>
|
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
@@ -21,12 +21,20 @@ export default (fragment) => {
|
|
21
21
|
parts.forEach((part) => {
|
22
22
|
if (!part) return;
|
23
23
|
|
24
|
-
if (part === 'sales'
|
24
|
+
if (part === 'sales'
|
25
|
+
|| part === 'all-property-for-sale'
|
26
|
+
|| part === 'property-for-sale'
|
27
|
+
|| part === 'properties-for-sale'
|
28
|
+
) {
|
25
29
|
search.channel = 'sales';
|
26
30
|
return;
|
27
31
|
}
|
28
32
|
|
29
|
-
if (part === 'lettings'
|
33
|
+
if (part === 'lettings'
|
34
|
+
|| part === 'all-property-for-rent'
|
35
|
+
|| part === 'property-for-rent'
|
36
|
+
|| part === 'properties-to-rent'
|
37
|
+
) {
|
30
38
|
search.channel = 'lettings';
|
31
39
|
return;
|
32
40
|
}
|
@@ -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.',
|