Skip to content

Commit

Permalink
Fixed bugs from merge 👍
Browse files Browse the repository at this point in the history
  • Loading branch information
EoinMcArdle99 committed Apr 7, 2020
1 parent 7822b21 commit 0cdc672
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class UserCreatedBets extends Component {
console.log(res);
this.setState({loadingBets : false, bets : res.body});
}else{
console.log("You have not created any bets");
this.setState({errorMsg : 'You have not created any bets yet'});
}
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class Dashboard extends React.Component{
}
if(redirectToBigRedButton){
return(
<Redirect to='/big-red-button' push />
<Redirect to='/bigRedButton' push />
)
}
if(renderLogin){
Expand Down
12 changes: 5 additions & 7 deletions express/funcs/betFuncs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1145,13 +1145,11 @@ function checkIfBetIsNew(bet, username){
return false;
}
});
if(!found){
bet.againstUsers.forEach(user => {
if(user.user_name === username){
return false;
}
})
}
bet.againstUsers.forEach(user => {
if(user.user_name === username){
return false;
}
});
}
else{
bet.commonBets.forEach(user => {
Expand Down
2 changes: 1 addition & 1 deletion express/logFiles/bigButton.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
112
118
12 changes: 6 additions & 6 deletions express/routes/bets.js
Original file line number Diff line number Diff line change
Expand Up @@ -874,9 +874,9 @@ router.post('/getFinishedBets', (req, res) => {
});

router.post('/getUserCreatedBets', (req, res) => {
utilFuncs.isSignedIn(req.cookies).then(profile => {
if(profile){
utilFuncs.getUserCreatedBets(profile.user_name)
utilFuncs.isSignedIn(req.cookies).then(user_name => {
if(user_name){
utilFuncs.getUserCreatedBets(user_name)
.then(bets => {
res.status(200).json({
'status' : 'success',
Expand Down Expand Up @@ -904,12 +904,12 @@ router.post('/getUserCreatedBets', (req, res) => {

router.post('/getBetsForUser', (req, res) => {
// Check if user is signed in
utilFuncs.isSignedIn(req.cookies).then(profile => {
if(profile){
utilFuncs.isSignedIn(req.cookies).then(user_name => {
if(user_name){
// Get all bets
utilFuncs.getBets().then(data => {
// Get specific bet data from user
utilFuncs.getBetsForUser(data, profile.user_name).then(bets => {
utilFuncs.getBetsForUser(data, user_name).then(bets => {
if(bets){
res.status(200).json({
'status' : 'success',
Expand Down

0 comments on commit 0cdc672

Please sign in to comment.