Cannot update collections that contain fragments
When updating (renaming, to be precise) a newly created collection, it seems to work fine.
When, however I add some fragments to it, and then try to rename, I get a 500
response from the server.
The output from the server is the following:
info: Updating properties to id=45ab07d8-ae69-4130-9c13-c34d31cb7f99, title=hhhdd
info: Saving collection 45ab07d8-ae69-4130-9c13-c34d31cb7f99
info: ValidationError: child "fragments" fails because ["fragments" at position 0 fails because ["0" must be an object]]
at Object.exports.process (/home/barlas/code/editoria/node_modules/pubsweet-server/node_modules/joi/lib/errors.js:181:19)
at Object._validateWithOptions (/home/barlas/code/editoria/node_modules/pubsweet-server/node_modules/joi/lib/any.js:651:31)
at Object.root.validate (/home/barlas/code/editoria/node_modules/pubsweet-server/node_modules/joi/lib/index.js:121:23)
at Collection.validate (/home/barlas/code/editoria/node_modules/pubsweet-server/src/models/Model.js:26:26)
at Collection.save (/home/barlas/code/editoria/node_modules/pubsweet-server/src/models/Model.js:39:10)
at Authorize.can.then.then.then.collection (/home/barlas/code/editoria/node_modules/pubsweet-server/src/routes/api_collections.js:88:30)