From a4b5b81bc34c746c96a3bcb360fe92180cad931f Mon Sep 17 00:00:00 2001 From: Lars Olav Velle Date: Mon, 15 Apr 2024 13:04:26 +0200 Subject: [PATCH] Update location.href to /players to prevent being sent to /players/players --- .../components/new-player-form/new-player-form.component.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/players/components/new-player-form/new-player-form.component.js b/src/pages/players/components/new-player-form/new-player-form.component.js index 826aee0..788b565 100644 --- a/src/pages/players/components/new-player-form/new-player-form.component.js +++ b/src/pages/players/components/new-player-form/new-player-form.component.js @@ -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(); } -} \ No newline at end of file +}