diff --git a/src/common/pages/RegisterNew/index.js b/src/common/pages/RegisterNew/index.js index 5ff09ab..4c0d465 100644 --- a/src/common/pages/RegisterNew/index.js +++ b/src/common/pages/RegisterNew/index.js @@ -45,6 +45,7 @@ class RegisterPage extends React.Component { errors: { email_exists: '', phone_exists: '', + referal_not_found: '', }, // form @@ -209,8 +210,16 @@ class RegisterPage extends React.Component { phone_exists: 'Nomer handphone sudah terdaftar' } }) + } else if (err.message.toLowerCase().includes('referal')) { + this.setState({ + errors: { + ...this.state.errors, + referal_not_found: 'Kode Referal Salah - Silahkan Hubungi Petugas BTN' + } + }) + } else { + message.error(err.message); } - // message.error(err.message); } }); }; @@ -576,7 +585,8 @@ class RegisterPage extends React.Component { margin="normal" type={"password"} fullWidth - helperText={"Hubungi petugas untuk mendapatkan hadiah"} + error={!!this.state.errors.referal_not_found} + helperText={this.state.errors.referal_not_found || 'Hubungi petugas untuk mendapatkan hadiah'} variant="outlined" />