From 4029dd791da45882e2d5033a48ae8aadff3ed41a Mon Sep 17 00:00:00 2001 From: Jason Park Date: Tue, 19 Sep 2023 02:33:50 +0900 Subject: [PATCH] chore: making response data dict concise --- src/lambda/get-user-threads/index.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lambda/get-user-threads/index.py b/src/lambda/get-user-threads/index.py index 20066cd9a..ab453996b 100644 --- a/src/lambda/get-user-threads/index.py +++ b/src/lambda/get-user-threads/index.py @@ -24,12 +24,15 @@ def get_user_threads(uid=""): thread_ids = [item['thread_id'] for item in results] # Determine the response data based on new_comment_count - response_data = True if new_comment_count > 1 else { - 'thread_ids': thread_ids, 'new_comment_count': new_comment_count} + response_data = { + 'thread_ids': thread_ids, + 'new_comment_count': new_comment_count, + 'new_comment_flag': new_comment_count > 1 + } body = JsonPayloadBuilder().add_status(True)\ .add_data(response_data)\ - .add_message('Fetched successfully').compile() + .add_message('').compile() return body