API & Client: profile edition refactor
This commit is contained in:
parent
d6bb413fb6
commit
faefe18e04
@ -429,7 +429,7 @@ def test_user_profile_valid_update(app):
|
||||
last_name='Doe',
|
||||
location='Somewhere',
|
||||
bio='just a random guy',
|
||||
birth_date='01/01/1980'
|
||||
birth_date='1980-01-01'
|
||||
)),
|
||||
headers=dict(
|
||||
Authorization='Bearer ' + json.loads(
|
||||
|
@ -207,7 +207,7 @@ def edit_user(user_id):
|
||||
user.bio = bio
|
||||
user.location = location
|
||||
user.birth_date = (
|
||||
datetime.datetime.strptime(birth_date, '%d/%m/%Y')
|
||||
datetime.datetime.strptime(birth_date, '%Y-%m-%d')
|
||||
if birth_date
|
||||
else None
|
||||
)
|
||||
|
@ -120,9 +120,7 @@ class ProfileEdit extends React.Component {
|
||||
<input
|
||||
name="birthDate"
|
||||
className="form-control input-lg"
|
||||
type="text"
|
||||
pattern="\d{1,2}/\d{1,2}/\d{4}"
|
||||
placeholder="dd/mm/yyyy"
|
||||
type="date"
|
||||
value={formProfile.birthDate}
|
||||
onChange={onHandleFormChange}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user