|
|
@ -151,17 +151,18 @@ function resolveBlockValues(context: any, block: any): any { |
|
|
const collectionItem = blockValue.collection_name |
|
|
const collectionItem = blockValue.collection_name |
|
|
? context[blockValue.collection_name] |
|
|
? context[blockValue.collection_name] |
|
|
: innerMostCollectionItem; |
|
|
: innerMostCollectionItem; |
|
|
if (!collectionItem) continue; |
|
|
if (!collectionItem) { |
|
|
|
|
|
throw new Error( |
|
|
switch (blockValue.variable_type) { |
|
|
`Collection not found: ${blockValue.collection_name || 'default collection'}` |
|
|
case 'current_item': |
|
|
); |
|
|
clonedBlock[key] = blockValue.path |
|
|
} |
|
|
? resolvePathValue(collectionItem.current_item, blockValue.path) |
|
|
|
|
|
: JSON.stringify(collectionItem.current_item); |
|
|
if (blockValue.variable_type === 'current_item') { |
|
|
break; |
|
|
clonedBlock[key] = blockValue.path |
|
|
default: |
|
|
? resolvePathValue(collectionItem.current_item, blockValue.path) |
|
|
clonedBlock[key] = collectionItem[blockValue.variable_type]; |
|
|
: JSON.stringify(collectionItem.current_item); |
|
|
break; |
|
|
} else { |
|
|
|
|
|
clonedBlock[key] = collectionItem[blockValue.variable_type]; |
|
|
} |
|
|
} |
|
|
} else if (Array.isArray(blockValue)) { |
|
|
} else if (Array.isArray(blockValue)) { |
|
|
// Resolve each item in the array
|
|
|
// Resolve each item in the array
|
|
|
|