fix: register flow

This commit is contained in:
Hasta Ragil Saputra 2019-01-31 21:33:09 +07:00
parent 8935bca9b0
commit e178fe8410

View File

@ -130,13 +130,13 @@ class RegisterPage extends React.Component {
register = () => { register = () => {
if (this.state.upload_photo === '') { // if (this.state.upload_photo === '') {
return message.warning("please upload photo"); // return message.warning("please upload photo");
} // }
//
if (this.state.upload_ktp === '') { // if (this.state.upload_ktp === '') {
return message.warning("please upload ktp"); // return message.warning("please upload ktp");
} // }
this.setState({ isLoading: true }); this.setState({ isLoading: true });
@ -146,14 +146,14 @@ class RegisterPage extends React.Component {
phone_number: this.state.phone_number, phone_number: this.state.phone_number,
password: this.state.password, password: this.state.password,
nric_number: this.state.no_ktp, nric_number: this.state.no_ktp,
nric_photo_path: this.state.upload_ktp, // nric_photo_path: this.state.upload_ktp,
photo: this.state.upload_photo, // photo: this.state.upload_photo,
address: this.state.address, // address: this.state.address,
province_id: this.state.province, // province_id: this.state.province,
city_id: this.state.city, // city_id: this.state.city,
district_id: this.state.district, // district_id: this.state.district,
subdistrict_id: this.state.subdistrict, // subdistrict_id: this.state.subdistrict,
zip_code: this.state.zip_code, // zip_code: this.state.zip_code,
referal: this.state.query.referal, referal: this.state.query.referal,
additional_data: {} additional_data: {}
}; };
@ -366,108 +366,108 @@ class RegisterPage extends React.Component {
/> />
</Grid> </Grid>
<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5,paddingTop:16 }}> {/*<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5,paddingTop:16 }}>*/}
<Upload {/*<Upload*/}
name="avatar" {/*name="avatar"*/}
listType="picture-card" {/*listType="picture-card"*/}
className="avatar-uploader" {/*className="avatar-uploader"*/}
showUploadList={false} {/*showUploadList={false}*/}
{...this.createUploadProps("ktp")} {/*{...this.createUploadProps("ktp")}*/}
> {/*>*/}
{upload_ktp ? <img src={upload_ktp} alt="avatar" style={{ {/*{upload_ktp ? <img src={upload_ktp} alt="avatar" style={{*/}
width: 104, {/*width: 104,*/}
height: 104 {/*height: 104*/}
}}/> : uploadButtonKtp} {/*}}/> : uploadButtonKtp}*/}
</Upload> {/*</Upload>*/}
</Grid> {/*</Grid>*/}
<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5, paddingTop:16 }}> {/*<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5, paddingTop:16 }}>*/}
<Upload {/*<Upload*/}
style={{ marginTop: 16, marginBottom: 8 }} {/*style={{ marginTop: 16, marginBottom: 8 }}*/}
name="avatar" {/*name="avatar"*/}
listType="picture-card" {/*listType="picture-card"*/}
className="avatar-uploader" {/*className="avatar-uploader"*/}
showUploadList={false} {/*showUploadList={false}*/}
{...this.createUploadProps("photo")} {/*{...this.createUploadProps("photo")}*/}
> {/*>*/}
{upload_photo ? <img src={upload_photo} alt="avatar" style={{ {/*{upload_photo ? <img src={upload_photo} alt="avatar" style={{*/}
width: 104, {/*width: 104,*/}
height: 104 {/*height: 104*/}
}}/> : uploadButtonPhoto} {/*}}/> : uploadButtonPhoto}*/}
</Upload> {/*</Upload>*/}
</Grid> {/*</Grid>*/}
<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}> {/*<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>*/}
<TextField {/*<TextField*/}
id="address" {/*id="address"*/}
label="Address" {/*label="Address"*/}
value={this.state.address} {/*value={this.state.address}*/}
onChange={this.handleChange('address')} {/*onChange={this.handleChange('address')}*/}
margin="normal" {/*margin="normal"*/}
variant="outlined" {/*variant="outlined"*/}
fullWidth {/*fullWidth*/}
/> {/*/>*/}
</Grid> {/*</Grid>*/}
<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}> {/*<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>*/}
<AutoComplete {/*<AutoComplete*/}
placeholder={"Province"} {/*placeholder={"Province"}*/}
onChange={({value}) => this.onChangeProvince(value)} {/*onChange={({value}) => this.onChangeProvince(value)}*/}
suggestions={this.place.provinces.map(p => { {/*suggestions={this.place.provinces.map(p => {*/}
return { {/*return {*/}
label: p.name, {/*label: p.name,*/}
value: p.id {/*value: p.id*/}
} {/*}*/}
})}/> {/*})}/>*/}
</Grid> {/*</Grid>*/}
<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}> {/*<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>*/}
<AutoComplete {/*<AutoComplete*/}
placeholder={"City"} {/*placeholder={"City"}*/}
onChange={({value}) => this.onChangeCity(value)} {/*onChange={({value}) => this.onChangeCity(value)}*/}
suggestions={this.place.cities.map(p => { {/*suggestions={this.place.cities.map(p => {*/}
return { {/*return {*/}
label: p.name, {/*label: p.name,*/}
value: p.id {/*value: p.id*/}
} {/*}*/}
})}/> {/*})}/>*/}
</Grid> {/*</Grid>*/}
<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}> {/*<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>*/}
<AutoComplete {/*<AutoComplete*/}
placeholder={"District"} {/*placeholder={"District"}*/}
onChange={({value}) => this.onChangeDistrict(value)} {/*onChange={({value}) => this.onChangeDistrict(value)}*/}
suggestions={this.place.districts.map(p => { {/*suggestions={this.place.districts.map(p => {*/}
return { {/*return {*/}
label: p.name, {/*label: p.name,*/}
value: p.id {/*value: p.id*/}
} {/*}*/}
})}/> {/*})}/>*/}
</Grid> {/*</Grid>*/}
<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}> {/*<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>*/}
<AutoComplete {/*<AutoComplete*/}
placeholder={"Subdistrict"} {/*placeholder={"Subdistrict"}*/}
onChange={({value}) => this.onChangeSubdistrict(value)} {/*onChange={({value}) => this.onChangeSubdistrict(value)}*/}
suggestions={this.place.subdistricts.map(p => { {/*suggestions={this.place.subdistricts.map(p => {*/}
return { {/*return {*/}
label: p.name, {/*label: p.name,*/}
value: p.id {/*value: p.id*/}
} {/*}*/}
})}/> {/*})}/>*/}
</Grid> {/*</Grid>*/}
<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}> {/*<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>*/}
<TextField {/*<TextField*/}
id="zip_code" {/*id="zip_code"*/}
label="Zip Code" {/*label="Zip Code"*/}
value={this.state.zip_code} {/*value={this.state.zip_code}*/}
onChange={this.handleChange('zip_code')} {/*onChange={this.handleChange('zip_code')}*/}
margin="normal" {/*margin="normal"*/}
variant="outlined" {/*variant="outlined"*/}
fullWidth {/*fullWidth*/}
/> {/*/>*/}
</Grid> {/*</Grid>*/}
<Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}> <Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}>
<TextField <TextField