So when when my axios request posts to my server it is converting my req header to a string. So if I console.log(data)
I get the following...
And then when I console.log(req.body)
from my server I get...
{ title: 'test 2',
start: '2018-10-13T05:00:00.000Z',
end: '2018-10-13T05:00:00.000Z',
color: 'blue' }
Why is it converting my start
and end
to a String? And how do I keep it as the Date
object?
Edit
Axios Post
export const addEvent = eventData => dispatch => {
console.log(eventData);
dispatch(setEventsLoading());
axios
.post("/api/events/", eventData)
...