Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
lin-erik authored Aug 3, 2018
2 parents 900884e + b01e6e4 commit d64726c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
5 changes: 2 additions & 3 deletions client/components/GlobalSearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ class GlobalSearch extends React.Component {
axios
.get('/results/', { params })
.then(response => {
console.log('Mood search', response.data);

this.setState({ movies: response.data });
})
.catch(err => console.error(err));
Expand Down Expand Up @@ -120,9 +122,6 @@ class GlobalSearch extends React.Component {
})
.catch(err => {
console.error('Error with endpoint of server', err);
})
.then(() => {
console.log(this.state.nowPlaying);
});
}

Expand Down
2 changes: 1 addition & 1 deletion client/components/Popup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Popup extends React.Component {

this.state = {
recommendations: [],
purchasing: false
purchase: false
};

this.purchaseMovie = this.purchaseMovie.bind(this);
Expand Down
1 change: 0 additions & 1 deletion client/components/Profile_Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ class Profile_Search extends React.Component {
axios
.get('/users/history/', { params })
.then(response => {
console.log(response.data);
let history = response.data.reverse();
if (history === null) history = [];
this.setState({ history });
Expand Down
12 changes: 8 additions & 4 deletions client/components/TagMovie.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class TagMovie extends React.Component {
'uncomfortable'
],
moods: [],
selected: 'whimsical',
selected: '',
//movie and user should eventually come from props after testing
movie: this.props.movie,
user: this.props.user
Expand Down Expand Up @@ -62,10 +62,10 @@ class TagMovie extends React.Component {

axios
.post('/save', movie)
.then((response) => {
.then(response => {
this.props.getUserHistory(this.props.user);
})
.catch((err) => console.log('FrontEnd err sending movie to server', err));
.catch(err => console.log('FrontEnd err sending movie to server', err));
}

handleDeleteMood(e) {
Expand All @@ -88,7 +88,11 @@ class TagMovie extends React.Component {
<select
onChange={this.handleChangeMood}
className="select is-multiple"
defaultValue=""
>
<option value="" disabled hidden>
Choose Mood
</option>
{this.state.dbMoods.map((option, index) => {
return (
<option value={option} key={index}>
Expand Down Expand Up @@ -126,7 +130,7 @@ class TagMovie extends React.Component {
</div>
</div>
<div className="column is-one-fifth">
<MovieCard movie={this.props.movie} user={this.props.user}/>
<MovieCard movie={this.props.movie} user={this.props.user} />
</div>
</div>
);
Expand Down
1 change: 1 addition & 0 deletions server/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ app.get('/results/:moods?', (req, res) => {

moodSearch(req.query.moods, function(err, data) {
if (err) throw err;
console.log(data);
res.send(data);
});
});
Expand Down

0 comments on commit d64726c

Please sign in to comment.