Added token to EditUser form
This commit is contained in:
parent
18b0747065
commit
6acdc352dc
1 changed files with 5 additions and 7 deletions
|
|
@ -44,7 +44,7 @@ function EditUser() {
|
|||
});
|
||||
}
|
||||
getInfo();
|
||||
});
|
||||
}, []);
|
||||
|
||||
function handleChange(e) {
|
||||
const name = e.target.name;
|
||||
|
|
@ -57,13 +57,11 @@ function EditUser() {
|
|||
|
||||
async function handleSubmit(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const { confirmPassword, ...filteredForm } = form;
|
||||
await axios
|
||||
.post(
|
||||
`${process.env.REACT_APP_API_ROOT}/auth/register`,
|
||||
filteredForm
|
||||
)
|
||||
.post(`${process.env.REACT_APP_API_ROOT}/auth/register`, {
|
||||
...form,
|
||||
token: Cookies.get('token'),
|
||||
})
|
||||
.then(() => {
|
||||
navigate('/login');
|
||||
})
|
||||
|
|
|
|||
Reference in a new issue