// NOTE: this function is for adding a __temp_key__ key to each object of a repeatable component
// in order to have a unique identifier for the DnD
import get from 'lodash/get';
import { getType, getOtherInfos } from './getAttributeInfos';
const formatComponentData = (data, ct, composSchema) => {
const recursiveFormatData = (data, schema) => {
return Object.keys(data).reduce((acc, current) => {
const type = getType(schema, current);
const value = get(data, current);
const compoUid = getOtherInfos(schema, [current, 'component']);
const isRepeatable = getOtherInfos(schema, [current, 'repeatable']);
if (!value) {
acc[current] = value;
return acc;
}
This file has been truncated. show original