Skip to content

Commit

Permalink
Merge pull request #148 from larvel/players-page-fix
Browse files Browse the repository at this point in the history
Update location.href to /players to prevent being sent to /players/pl…
  • Loading branch information
thordy authored Apr 16, 2024
2 parents 456ff52 + a4b5b81 commit 141deb0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,18 @@ module.exports = {
if (this.state.isAdd) {
axios.post(`${window.location.origin}/players`, body)
.then(response => {
location.href = 'players';
location.href = '/players';
}).catch(error => {
console.log(error);
});
} else {
axios.put(`${window.location.origin}/players/${this.state.id}`, body)
.then(response => {
location.href = 'players';
location.href = '/players';
}).catch(error => {
console.log(error);
});
}
event.preventDefault();
}
}
}

0 comments on commit 141deb0

Please sign in to comment.