Merge pull request #4717 from strapi/fix/json-data

Fix json input
This commit is contained in:
Alexandre BODIN 2019-12-12 17:40:10 +01:00 committed by GitHub
commit 146756fe89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,13 @@ const cleanData = (retrievedData, currentSchema, componentsSchema) => {
switch (attrType) {
case 'json':
cleanedData = value;
try {
cleanedData = JSON.parse(value);
} catch (err) {
console.error(err);
cleanedData = value;
}
break;
case 'date':
case 'datetime':