Skip to content

Commit

Permalink
Removed console logs and an unused variable
Browse files Browse the repository at this point in the history
  • Loading branch information
eabrigham committed Aug 24, 2018
1 parent 6f493ec commit 8a8cbcf
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 22 deletions.
2 changes: 0 additions & 2 deletions src/components/ChangePasswordForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const ChangePasswordForm = (props) => {

console.log(formData)
if (formData["new"] !== formData["new_confirmation"]) {
console.error('passwords do not match')
props.feedbackMessage('Passwords do not match', 'ChangePasswordForm')
return false
}
Expand All @@ -36,7 +35,6 @@ const ChangePasswordForm = (props) => {
.then(data => console.log(data))
.then(props.feedbackMessage('Changed password successfully', 'ChangePasswordForm'))
.catch(err => {
console.error(err)
props.feedbackMessage('Change password failed', 'ChangePasswordForm')
})
}
Expand Down
7 changes: 0 additions & 7 deletions src/components/PostForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ const PostForm = (props) => {
}
e.target.reset()

console.log(formData)

const authHeader = {headers: {Authorization: `Token token=${props.token}`} }
console.log('In PostForm and the auth header is ', authHeader)

axios({
method: "post",
url: `${config.apiUrl}/posts`,
Expand All @@ -33,12 +28,10 @@ const PostForm = (props) => {
data: {post: formData}
})
.then(res => {
console.log(res.data.post)
props.addPost(res.data.post)

})
.catch(err => {
console.log(err)
props.feedbackMessage('Create post failed', 'PostForm')
})
};
Expand Down
5 changes: 0 additions & 5 deletions src/components/SignInForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@ const SignInForm = (props) => {
}
e.target.reset()

console.log(formData)

axios.post(`${config.apiUrl}/sign-in`, {credentials: formData})
// store token
.then(res => {
console.log(res)
props.setToken(res.data.user.token)
return res.data.user.token
})
Expand All @@ -37,13 +34,11 @@ const SignInForm = (props) => {
}
}))
.then(res => {
console.log(res)
return res
})
.then(res => props.setPosts(res.data.posts))
.then(props.feedbackMessage('Signed in successfully', 'SignInForm'))
.catch(err => {
console.error(err)
props.feedbackMessage('Sign in failed. Check your username and password.', 'SignInForm')
})
}
Expand Down
2 changes: 0 additions & 2 deletions src/components/SignOutForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const SignOutForm = (props) => {
}
})
.then(res => {
console.log(res)
return res
})
.then(res => {
Expand All @@ -29,7 +28,6 @@ const SignOutForm = (props) => {
.then(props.feedbackMessage('Signed out successfully', 'SignOutForm'))
// TODO setter method get data to App.js
.catch(err => {
console.error(err)
props.feedbackMessage('Signed out failed', 'SignOutForm')
})
}
Expand Down
3 changes: 0 additions & 3 deletions src/components/SignUpForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,15 @@ const SignUpForm = (props) => {
// clear out the form after retreiving data
e.target.reset()

console.log(formData)
if (formData["password"] !== formData["password_confirmation"]) {
props.feedbackMessage('Passwords do not match', 'SignUpForm')
return false
}
axios.post(`${config.apiUrl}/sign-up`, {credentials: formData})
.then(data => {
console.log(data)
props.feedbackMessage('Signed up successfully', 'SignUpForm')
})
.catch(err => {
console.error(err)
props.feedbackMessage('Sign up was unable to run', 'SignUpForm')
})
}
Expand Down
3 changes: 0 additions & 3 deletions src/containers/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ class App extends Component {
this.setState(prevState => {
return {token: token}
})
console.log('In App.js and the state token is ', this.state.token)
}

setPosts (postsArray) {
console.log(postsArray)
this.setState(() => {
return { posts: postsArray }
})
Expand All @@ -47,7 +45,6 @@ class App extends Component {
// passing this thing down to forms that need to trigger messages
// binding this since it uses setState
feedbackMessage (message, componentName) {
console.log('feedbackMessage ran')
this.setState({
feedbackComponent: componentName,
feedbackMsg: message
Expand Down

0 comments on commit 8a8cbcf

Please sign in to comment.