cleans performFieldOperations
This commit is contained in:
@@ -277,18 +277,12 @@ async function performFieldOperations(entityConfig, args) {
|
||||
if (data[field.name] === '') dataCopy[field.name] = null;
|
||||
}
|
||||
|
||||
// TODO: sanitize additional field types as necessary i.e. relationships
|
||||
|
||||
if (field.type === 'checkbox') {
|
||||
if (data[field.name] === 'true') dataCopy[field.name] = true;
|
||||
if (data[field.name] === 'false') dataCopy[field.name] = false;
|
||||
if (data[field.name] === '') dataCopy[field.name] = false;
|
||||
}
|
||||
|
||||
if (field.type === 'richText' && typeof data[field.name] === 'string') {
|
||||
dataCopy[field.name] = JSON.parse(data[field.name]);
|
||||
}
|
||||
|
||||
// If richText content comes through as a string, parse it into JSON
|
||||
|
||||
if (field.type === 'richText' && typeof data[field.name] === 'string') {
|
||||
|
||||
Reference in New Issue
Block a user