fix: update DocumentSync initialization to pass EspoCRMAPI as first argument

This commit is contained in:
bsiggel
2026-03-31 08:04:56 +00:00
parent 3086afa855
commit f9c8aa7c6d

View File

@@ -56,8 +56,10 @@ async def handler(event_data: Dict[str, Any], ctx: FlowContext[Any]) -> None:
ctx.logger.info(f"Document ID: {entity_id}")
ctx.logger.info("=" * 80)
# Initialize sync utils
sync_utils = DocumentSync(ctx)
# Initialize sync utils (EspoCRMAPI must be passed as first arg, not ctx)
from services.espocrm import EspoCRMAPI
espocrm = EspoCRMAPI(ctx)
sync_utils = DocumentSync(espocrm, context=ctx)
try:
# Step 1: Get download info from EspoCRM