Skip to content

Commit

Permalink
chore: adding logging statements
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonNotJson committed Sep 17, 2023
1 parent 149f2d0 commit ab4f7ae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lambda/patch-thread/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def patch_thread(board_id, uid, thread_id, thread, action):
dt_now = datetime.now().strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3] + 'Z'

if action == 'update':
print("action update triggered")
table.update_item(
Key={
"board_id": board_id,
Expand All @@ -23,6 +24,7 @@ def patch_thread(board_id, uid, thread_id, thread, action):
},
)
elif action == 'like':
print("action like triggered")
# Add uid to the 'likes' list if it's not already there
table.update_item(
Key={
Expand All @@ -36,6 +38,7 @@ def patch_thread(board_id, uid, thread_id, thread, action):
},
)
elif action == 'dislike':
print("action dislike triggered")
# Remove uid from the 'likes' list if it's already there

response = table.get_item(Key={
Expand Down Expand Up @@ -73,6 +76,7 @@ def patch_thread(board_id, uid, thread_id, thread, action):
)
# Increase comment_count by 1
elif action == 'update_incr':
print("action count increased triggered")
table.update_item(
Key={
"board_id": board_id,
Expand All @@ -91,6 +95,7 @@ def patch_thread(board_id, uid, thread_id, thread, action):

# Decrease comment_count by 1
elif action == 'update_decr':
print("action count decrease triggered")
# Fetch the current item to get the current comment_count
response = table.get_item(
Key={
Expand Down

0 comments on commit ab4f7ae

Please sign in to comment.