Skip to content

Commit

Permalink
Update location.href to /players to prevent being sent to /players/pl…
Browse files Browse the repository at this point in the history
…ayers
  • Loading branch information
larvel committed Apr 15, 2024
1 parent 456ff52 commit a4b5b81
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 a4b5b81

Please sign in to comment.