Skip to content
This repository was archived by the owner on Oct 6, 2024. It is now read-only.

Commit aed2d9a

Browse files
committed
now all attributes can be updated
1 parent 0010aec commit aed2d9a

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

src/components/Profile.js

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ class Profile extends React.Component {
1212
firstName: "",
1313
id: 0,
1414
lastName: "",
15-
DOB_MONTH: "",
16-
Street: "",
17-
City: "",
18-
State: "",
15+
dob: "",
16+
street: "",
17+
city: "",
18+
state: "",
1919
zipCode: "",
2020
email: ""
2121
}
@@ -38,10 +38,10 @@ class Profile extends React.Component {
3838
lastName: user.lastName,
3939
zipCode: user.zipCode,
4040
email: user.email,
41-
Street : user.street,
42-
State : user.state,
43-
DOB_MONTH : user.dob,
44-
City: user.city
41+
street : user.street,
42+
state : user.state,
43+
dob : user.dob,
44+
city: user.city
4545
}
4646
}
4747
)
@@ -77,7 +77,11 @@ class Profile extends React.Component {
7777
firstName: user.firstName,
7878
lastName: user.lastName,
7979
zipCode: user.zipCode,
80-
email: user.email
80+
email: user.email,
81+
street : user.street,
82+
state : user.state,
83+
dob : user.dob,
84+
city: user.city
8185
}
8286
}
8387
);
@@ -107,18 +111,18 @@ class Profile extends React.Component {
107111
<h2>Date of Birth</h2>
108112
<hr></hr>
109113
<h6>Choose your Birthday</h6>
110-
<input type="month" name="bd" value={this.state.currentUser.DOB_MONTH} onChange={this.handleInputChange}/>
114+
<input type="month" name="dob" value={this.state.currentUser.dob} onChange={this.handleInputChange}/>
111115
</div>
112116
<div className="column">
113117
<h2> Location </h2>
114118
<hr></hr>
115119
<h6>Street</h6>
116-
<input type="text" name="street" value={this.state.currentUser.Street} onChange={this.handleInputChange}/>
120+
<input type="text" name="street" value={this.state.currentUser.street} onChange={this.handleInputChange}/>
117121
<h6>City</h6>
118-
<input type="text" name="city" value={this.state.currentUser.City} onChange={this.handleInputChange}/>
122+
<input type="text" name="city" value={this.state.currentUser.city} onChange={this.handleInputChange}/>
119123
<h6>State</h6>
120124
<p>
121-
<select name="state" value={this.state.currentUser.State} onChange={this.handleInputChange}>
125+
<select name="state" value={this.state.currentUser.state} onChange={this.handleInputChange}>
122126
<option value="AL">Alabama</option>
123127
<option value="AK">Alaska</option>
124128
<option value="AZ">Arizona</option>
@@ -173,7 +177,7 @@ class Profile extends React.Component {
173177
</select>
174178
</p>
175179
<h6>Zip</h6>
176-
<input type="text" name="zip" value={this.state.currentUser.zipCode} onChange={this.handleInputChange}/>
180+
<input type="text" name="zipCode" value={this.state.currentUser.zipCode} onChange={this.handleInputChange}/>
177181
<h6>Email</h6>
178182
<input type="text" name="email" value={this.state.currentUser.email} readOnly={true}/>
179183
<br/>

0 commit comments

Comments
 (0)