diff --git a/bitbylaw/steps/advoware_cal_sync/calendar_sync_api_step.py b/bitbylaw/steps/advoware_cal_sync/calendar_sync_api_step.py index 8886625e..c778dfc3 100644 --- a/bitbylaw/steps/advoware_cal_sync/calendar_sync_api_step.py +++ b/bitbylaw/steps/advoware_cal_sync/calendar_sync_api_step.py @@ -12,7 +12,8 @@ config = { 'flows': ['advoware'] } -async def handler(req, context): +async def handler(req): + context = req.context try: # Konfiguration aus Request-Body body = req.get('body', {}) diff --git a/bitbylaw/steps/advoware_cal_sync/calendar_sync_cron_step.py b/bitbylaw/steps/advoware_cal_sync/calendar_sync_cron_step.py index 03ca6719..0cfeb75d 100644 --- a/bitbylaw/steps/advoware_cal_sync/calendar_sync_cron_step.py +++ b/bitbylaw/steps/advoware_cal_sync/calendar_sync_cron_step.py @@ -14,7 +14,7 @@ config = { 'flows': ['advoware'] } -async def get_advoware_employees(advoware): +async def get_advoware_employees(context, advoware): """Fetch list of employees from Advoware.""" try: result = await advoware.api_call('api/v1/advonet/Mitarbeiter', method='GET', params={'aktiv': 'true'}) @@ -33,7 +33,7 @@ async def handler(context): advoware = AdvowareAPI(context) # Fetch employees - employees = await get_advoware_employees(advoware) + employees = await get_advoware_employees(context, advoware) if not employees: context.logger.error("Keine Mitarbeiter gefunden. Cron abgebrochen.") return {'status': 500, 'body': {'error': 'Keine Mitarbeiter gefunden'}}