API & Client: profile edition refactor

This commit is contained in:
Sam 2018-05-08 18:26:42 +02:00
parent d6bb413fb6
commit faefe18e04
3 changed files with 3 additions and 5 deletions

View File

@ -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(

View File

@ -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
)

View File

@ -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}
/>