Fix event handler signature to async def handler(event_data, context)
This commit is contained in:
@@ -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', {})
|
||||
|
||||
@@ -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'}}
|
||||
|
||||
Reference in New Issue
Block a user