The same is working for other collections, but the user endpoint you need to provide only the fields, not the data, it’s a pity, that this is not consistent with other endpoints…
const restaurant = await axios.put(
`http://localhost:1337/api/users/${user.id}`,
{
username: 'newname',
menus: [...user.menus.map((item)=>item.id), menu["data"].data.id],
},
{
headers: {
Authorization: `Bearer ${jwt}`,
},
}
);