Added token to EditUser form

This commit is contained in:
Ceferino Patino 2022-03-19 20:28:36 -05:00
commit 6acdc352dc

View file

@ -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');
})