Open newsch opened 7 years ago
This is fixed on the frontend but should still be updated on the backend
It's unclear whether this is still an issue - none of the events currently in the database have this issue as far as I can tell (querying http://abe.olin.build/events?start=2017&end=2018 returned 685 events all with lists for labels), and when trying to create a new event with:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \
"allDay": true, \
"description": "Time for tea", \
"end": "2018-04-27T18:49:41.508Z", \
"labels": "string", \
"location": "EH4L", \
"start": "2018-04-27T18:49:41.508Z", \
"title": "Tea time", \
"visibility": "public" \
}' 'http://localhost:3000/events/'
I got a 400 with the response:
{
"error_message": "ValidationError (Event:None) (Only lists and tuples may be used in a list field: ['labels'])",
"error_type": "validation",
"validation_errors": [
"labels"
]
}
Single strings can be passed in for the labels field, which are parsed incorrectly somewhere between the database and the json response, splitting up the string into an array of characters. link to issue on frontend.
Here's an example event in mongodb:
and the JSON output: