in api/wheel_participant.py [0:0]
def list_participants(event):
"""
Gets the participants for the specified wheel_id
:param event: Lambda event containing the API Gateway request path parameter wheel_id
{
"pathParameters":
{
"wheel_id": string ID of the wheel (DDB Hash Key)
},
}
:return: response dictionary containing a list of participants
{
"body":
[
participant1,
participant2,
...
participantn,
]
}
"""
wheel_id = event['pathParameters']['wheel_id']
# Make sure the wheel exists
Wheel.get_existing_item(Key={'id': wheel_id})
return list(WheelParticipant.iter_query(KeyConditionExpression=Key('wheel_id').eq(wheel_id)))