diff --git a/package-lock.json b/package-lock.json
index 2557cee..062ebd4 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -7894,6 +7894,7 @@
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
+ "optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -7905,15 +7906,18 @@
},
"code-point-at": {
"version": "1.1.0",
- "bundled": true
+ "bundled": true,
+ "optional": true
},
"concat-map": {
"version": "0.0.1",
- "bundled": true
+ "bundled": true,
+ "optional": true
},
"console-control-strings": {
"version": "1.1.0",
- "bundled": true
+ "bundled": true,
+ "optional": true
},
"core-util-is": {
"version": "1.0.2",
@@ -8003,7 +8007,8 @@
},
"inherits": {
"version": "2.0.3",
- "bundled": true
+ "bundled": true,
+ "optional": true
},
"ini": {
"version": "1.3.5",
@@ -8012,6 +8017,7 @@
"is-fullwidth-code-point": {
"version": "1.0.0",
"bundled": true,
+ "optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -8034,6 +8040,7 @@
"minipass": {
"version": "2.3.5",
"bundled": true,
+ "optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@@ -8120,7 +8127,8 @@
},
"number-is-nan": {
"version": "1.0.1",
- "bundled": true
+ "bundled": true,
+ "optional": true
},
"object-assign": {
"version": "4.1.1",
@@ -8129,6 +8137,7 @@
"once": {
"version": "1.4.0",
"bundled": true,
+ "optional": true,
"requires": {
"wrappy": "1"
}
@@ -8214,6 +8223,7 @@
"string-width": {
"version": "1.0.2",
"bundled": true,
+ "optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
diff --git a/src/common/pages/RegisterNew/index.js b/src/common/pages/RegisterNew/index.js
index 9cd62c4..79a8d4a 100644
--- a/src/common/pages/RegisterNew/index.js
+++ b/src/common/pages/RegisterNew/index.js
@@ -40,6 +40,8 @@ class RegisterPage extends React.Component {
fileList_ktp: [],
fileList_photo: [],
+ query: {},
+
// form
confirmPassword: "",
phone_number: "",
@@ -65,6 +67,18 @@ class RegisterPage extends React.Component {
}
componentDidMount() {
+ let {location:{search}} = this.props;
+ search = search.substr(1);
+
+ const query = search.split("&")
+ .map(q => q.split('='))
+ .reduce((all, q) => {
+ all[q[0]] = q[1];
+ return all;
+ }, {});
+
+ this.setState({query});
+
this.place.getAllProvince();
}
@@ -114,6 +128,15 @@ class RegisterPage extends React.Component {
};
register = () => {
+
+ if (this.state.upload_photo === '') {
+ return message.warning("please upload photo");
+ }
+
+ if (this.state.upload_ktp === '') {
+ return message.warning("please upload ktp");
+ }
+
this.setState({ isLoading: true });
let data = {
fullname: this.state.full_name,
@@ -129,11 +152,13 @@ class RegisterPage extends React.Component {
district_id: this.state.district,
subdistrict_id: this.state.subdistrict,
zip_code: this.state.zip_code,
+ referal: this.state.query.referal,
additional_data: {}
};
this.authStore.register(data).then(res => {
setTimeout(() => {
this.setState({ isLoading: false });
+ message.success("Please check your email to confirm your account");
}, 1000);
}).catch(err => {
this.setState({ isLoading: false });
@@ -476,10 +501,31 @@ class RegisterPage extends React.Component {
+
- { - event.preventDefault(); - this.setState({stepIndex: 0, finished: false}); - }} - > - Click here - to reset the example. -
- ) : ( -{this.getStepContent(stepIndex)}
-