I want to concatenate ALLActivity with Data but I don't know how to achieve that.
const [ALLActivity, setAllActivity] = useState([]);
I have different input fields that I get using onchange. They are then stored in a useState ALLActivity.
const getActivity = (e) => {
setAllActivity({ ...ALLActivity, [e.target.name]: e.target.value });
};
I want to combine the fields if ALLActivity and id
const submitnewActivity = (e) => {
const Data = {
ALLActivity, //What should I do to fix here
{ id: e },
}
};
axios
.patch("edit-activity/",ALLActivity, //I want pass id along like this
{
headers: headers,
}
)