Browse Source

Fix getting current item

pull/6359/head
mohamedsalem401 1 year ago
parent
commit
9d142f42fc
  1. 5
      packages/core/src/data_sources/model/collection_component/CollectionComponent.ts

5
packages/core/src/data_sources/model/collection_component/CollectionComponent.ts

@ -136,7 +136,6 @@ function deepCloneObject<T extends Record<string, any> | null | undefined>(obj:
}
function resolveBlockValues(context: any, block: any): any {
console.log("🚀 ~ resolveBlockValues ~ context:", context)
const { innerMostCollectionItem } = context;
const clonedBlock = deepCloneObject(block);
@ -156,8 +155,8 @@ function resolveBlockValues(context: any, block: any): any {
switch (blockValue.variable_type) {
case 'current_item':
clonedBlock[key] = blockValue.path
? resolvePathValue(collectionItem, blockValue.path)
: JSON.stringify(collectionItem);
? resolvePathValue(collectionItem.current_item, blockValue.path)
: JSON.stringify(collectionItem.current_item);
break;
default:
clonedBlock[key] = collectionItem[blockValue.variable_type];

Loading…
Cancel
Save