Skip to content

Commit

Permalink
Fixed edit profile page and removed unimplemented email changing
Browse files Browse the repository at this point in the history
  • Loading branch information
LordSputnik committed Dec 5, 2015
1 parent 6bff3b6 commit 02ecf85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
11 changes: 0 additions & 11 deletions src/client/components/forms/profile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,13 @@ module.exports = React.createClass({
displayName: 'profileForm',
propTypes: {
bio: React.PropTypes.string,
email: React.PropTypes.string,
id: React.PropTypes.number
},
getInitialState() {
'use strict';

return {
id: this.props.id,
email: this.props.email,
bio: this.props.bio,
waiting: false
};
Expand All @@ -50,7 +48,6 @@ module.exports = React.createClass({

const data = {
id: this.state.id,
email: this.refs.email.getValue().trim(),
bio: this.refs.bio.getValue().trim()
};

Expand All @@ -73,14 +70,6 @@ module.exports = React.createClass({
onSubmit={this.handleSubmit}
>
{loadingElement}
<Input
defaultValue={this.state.email}
label="Email"
labelClassName="col-md-3"
ref="email"
type="text"
wrapperClassName="col-md-9"
/>
<Input
defaultValue={this.state.bio}
label="Bio"
Expand Down
7 changes: 4 additions & 3 deletions src/server/routes/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ router.get('/edit', auth.isAuthenticated, (req, res, next) => {
.then((user) => {
const props = {
id: user.id,
email: user.email,
bio: user.bio
};

Expand All @@ -61,10 +60,12 @@ router.post('/edit/handler', auth.isAuthenticated, (req, res) => {

bbws.put(
`/user/${req.body.id}/`,
{bio: req.body.bio, email: req.body.email},
{bio: req.body.bio},
{accessToken: req.session.bearerToken}
)
.then(res.send)
.then((response) => {
res.send(response);
})
.catch(() => {
req.session.error =
'An internal error occurred while modifying profile';
Expand Down

0 comments on commit 02ecf85

Please sign in to comment.