fixes bug with clearing hasMany relationship field values

This commit is contained in:
James
2020-10-08 19:31:26 -04:00
parent 234ed07ad6
commit 918d3bd2bc

View File

@@ -59,12 +59,14 @@ const traverseFields = (args) => {
if (data[field.name] === '') dataCopy[field.name] = false;
}
// If richText content comes through as a string, parse it into JSON
if (field.type === 'richText' && typeof data[field.name] === 'string') {
dataCopy[field.name] = JSON.parse(data[field.name]);
}
if (field.type === 'relationship' && (data[field.name] === '' || data[field.name] === 'none' || data[field.name] === 'null')) {
dataCopy[field.name] = null;
}
accessPromises.push(accessPromise({
data,
originalDoc,