Skip to content

Commit

Permalink
fix: restore GET /blogs/{BlogId} route handling in lift-club-lambda.py
Browse files Browse the repository at this point in the history
  • Loading branch information
LokoMoloko98 committed Jan 19, 2025
1 parent f6c82af commit 980ebba
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lift-club-lambda/lift-club-lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ def lambda_handler(event, context):
if event['routeKey'] == "DELETE /blogs/{BlogId}":
table.delete_item(KeyConditionExpression=Key('BlogId').eq(event['pathParameters']['BlogId']))
body = 'Deleted item ' + event['pathParameters']['BlogId']
# elif event['routeKey'] == "GET /blogs/{BlogId}":
# body = table.query(KeyConditionExpression=Key('BlogId').eq(event['pathParameters']['BlogId']))
# body = body["Item"]
# responseBody = [{'BlogId': body['BlogId'], 'BlogTitle': body['BlogTitle'], 'PublishedDate': body['PublishedDate']}]
# body = responseBody
elif event['routeKey'] == "GET /blogs/{BlogId}":
body = table.query(KeyConditionExpression=Key('BlogId').eq(event['pathParameters']['BlogId']))
body = body["Item"]
responseBody = [{'BlogId': body['BlogId'], 'BlogTitle': body['BlogTitle'], 'PublishedDate': body['PublishedDate']}]
body = responseBody
# elif event['routeKey'] == "GET /items":
# body = table.scan()
# body = body["Items"]
Expand Down

0 comments on commit 980ebba

Please sign in to comment.