Need help in code while updating userdetails

hey there morning gudwin this side , sir i am using stytch auth system in my project and i have done the setup using nodjs but facing issue in updating user data ,could you please tell whats going wrong with my code here is my code app.put(‘/update-user/:user_id’, async (req, res, next) => {
try {
const user_id = req.params.user_id;
const params = {
name: {
first_name: req.body.first_name, // Use the first_name from the request body
last_name: req.body.last_name, // Use the last_name from the request body
},
trusted_metadata: {
role: “ADMIN”
}
};
const response = await client.users.update({user_id}, params);
if (response.status_code === 200) {
const updatedUser = response.user;
res.json({ message: ‘User information updated’, updatedUser });
} else {
res.status(response.status_code).json({ message: ‘Update failed’, response });
}
} catch (error) {
next(error);
}
});

Heya Gudwin,

Thanks for reaching out!

Would you mind sharing a request_id for one of these failed update requests? I’d love to dig into our logs and find out what is going wrong.

Best,
Christopher
Stytch Developer Success