Compare commits
1 Commits
make-error
...
verifiy-el
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b2bfafa320 |
@@ -37,7 +37,8 @@ class SignUp extends React.Component {
|
|||||||
validated: false,
|
validated: false,
|
||||||
memberType:"S",
|
memberType:"S",
|
||||||
showValidationErrors: false,
|
showValidationErrors: false,
|
||||||
validationErrors:[]
|
validationErrors:[],
|
||||||
|
draggableDialog:false
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount = () => {
|
componentDidMount = () => {
|
||||||
@@ -63,7 +64,8 @@ class SignUp extends React.Component {
|
|||||||
"phonenumber": this.state.phonenumber,
|
"phonenumber": this.state.phonenumber,
|
||||||
"birthdate": this.state.birthdate.toISOString(),
|
"birthdate": this.state.birthdate.toISOString(),
|
||||||
"consent" : this.state.agreedTerms,
|
"consent" : this.state.agreedTerms,
|
||||||
"type": this.state.memberType
|
"type": this.state.memberType,
|
||||||
|
"useruuid": "1234567"
|
||||||
|
|
||||||
// "eligibility": {
|
// "eligibility": {
|
||||||
// "tracking_id": "1234567",
|
// "tracking_id": "1234567",
|
||||||
@@ -105,13 +107,26 @@ class SignUp extends React.Component {
|
|||||||
// alert('NO benefits found for this member');
|
// alert('NO benefits found for this member');
|
||||||
// }
|
// }
|
||||||
}).catch(function (err) {
|
}).catch(function (err) {
|
||||||
if (err.response.status === 422){
|
switch(err.response.status){
|
||||||
//Unprocessable Entity (validation failed)
|
case 403:
|
||||||
state.setState(Object.assign(state.state, {showValidationErrors:true, validationErrors:err.response.data.data}))
|
//Forbidden (not eligible)
|
||||||
}else{
|
console.log(err.response.data);
|
||||||
console.log('Error to get eligibility: ', err);
|
let messageArray = [
|
||||||
alert('NO benefits found for this member');
|
{
|
||||||
this.handleRequestClose();
|
message:err.response.data.message
|
||||||
|
}
|
||||||
|
]
|
||||||
|
state.setState(Object.assign(state.state, {showValidationErrors:true, validationErrors:messageArray, draggableDialog:false}))
|
||||||
|
break;
|
||||||
|
case 422:
|
||||||
|
//Unprocessable Entity (validation failed)
|
||||||
|
state.setState(Object.assign(state.state, {showValidationErrors:true, validationErrors:err.response.data.data, draggableDialog:true}))
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
console.log('Error to get eligibility: ', err);
|
||||||
|
alert('NO benefits found for this member');
|
||||||
|
this.handleRequestClose();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -192,7 +207,7 @@ class SignUp extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<form className="">
|
<form className="">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<ValidationErrorsInfoDialog open = {this.state.showValidationErrors} errorMessages = {this.state.validationErrors} modal={true} onDismiss={this.handleValidationErrosDialogDismiss.bind(this)}/>
|
<ValidationErrorsInfoDialog open = {this.state.showValidationErrors} errorMessages = {this.state.validationErrors} draggable={this.state.draggableDialog} onDismiss={this.handleValidationErrosDialogDismiss.bind(this)}/>
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<TextField
|
<TextField
|
||||||
floatingLabelText="First Name"
|
floatingLabelText="First Name"
|
||||||
|
|||||||
Reference in New Issue
Block a user