diff --git a/users/userservice/user-service.js b/users/userservice/user-service.js index e4dcff6..0a53704 100644 --- a/users/userservice/user-service.js +++ b/users/userservice/user-service.js @@ -119,7 +119,7 @@ app.post('/adduser', async (req, res) => { }); await newUser.save(); - res.json(newUser); + res.status(200).json(newUser); } catch (error) { res.status(400).json({ error: error.message }); }}); diff --git a/webapp/src/components/AddUser.jsx b/webapp/src/components/AddUser.jsx index b677964..1e7225c 100644 --- a/webapp/src/components/AddUser.jsx +++ b/webapp/src/components/AddUser.jsx @@ -13,7 +13,7 @@ const AddUser = () => { const [cpassword, setcPassword] = useState(''); const [error, setError] = useState(''); const [openSnackbar, setOpenSnackbar] = useState(false); - const { navigate } = useNavigate(); + const navigate = useNavigate(); const addUser = async () => { try {