Trim data before saving

This commit is contained in:
Kimmo Puputti 2018-03-12 16:52:34 +02:00
parent 6e707c623d
commit fc730244ba
2 changed files with 6 additions and 2 deletions

View file

@ -131,7 +131,7 @@ export class AuthenticationPageComponent extends Component {
const handleSubmitSignup = values => {
const { fname, lname, ...rest } = values;
const params = { firstName: fname, lastName: lname, ...rest };
const params = { firstName: fname.trim(), lastName: lname.trim(), ...rest };
submitSignup(params);
};

View file

@ -54,7 +54,11 @@ export class ProfileSettingsPageComponent extends Component {
// Ensure that the optional bio is a string
const bio = rawBio || '';
const profile = { firstName, lastName, bio };
const profile = {
firstName: firstName.trim(),
lastName: lastName.trim(),
bio: bio.trim(),
};
const uploadedImage = this.props.image;
// Update profileImage only if file system has been accessed