fix: bug with local API and not passing array / block data

This commit is contained in:
James
2021-10-07 20:25:42 -04:00
parent 4432031341
commit fd4fbe8c8b

View File

@@ -345,7 +345,7 @@ const traverseFields = (args: Arguments): void => {
if (field.type === 'array' || field.type === 'blocks') {
const hasRowsOfNewData = Array.isArray(data[field.name]);
const newRowCount = hasRowsOfNewData ? (data[field.name] as Record<string, unknown>[]).length : 0;
const newRowCount = hasRowsOfNewData ? (data[field.name] as Record<string, unknown>[]).length : undefined;
// Handle cases of arrays being intentionally set to 0
if (data[field.name] === '0' || data[field.name] === 0 || data[field.name] === null) {