Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const dataValueToUpdate = _.cloneDeep((blockPreset?.value?.data || [])).map(dataItem => {
- let value = false;
- for(const schema of blockPreset?.value?.schema || []) {
- if(schema.type === 'image') {
- if(typeof dataItem[schema.key] === 'object') {
- const name = `${utils.uuidv4()}_uploading`;
- images.push({ file: dataItem[schema.key], name });
- dataItem[schema.key] = name;
- }
- value = dataItem;
- } else {
- value = dataItem;
- }
- }
- return value;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement