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

Loading…
Cancel
Save