From d12e52ce89f215c74eeddf2c19cd102ded785958 Mon Sep 17 00:00:00 2001 From: junah201 Date: Sun, 17 Dec 2023 23:20:17 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9BDecimal=20type=20=EA=B4=80=EB=A0=A8?= =?UTF-8?q?=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/lambdas/get_config/main.py | 7 ++++++- backend/lambdas/post_config/main.py | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/backend/lambdas/get_config/main.py b/backend/lambdas/get_config/main.py index 132e448..a56afc8 100644 --- a/backend/lambdas/get_config/main.py +++ b/backend/lambdas/get_config/main.py @@ -57,11 +57,16 @@ def lambda_handler(event, context): }) } + item = { + key: str(value) if isinstance(value, str) else int(value) + for key, value in response["Item"].items() + } + return { "statusCode": "200", "headers": { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*' }, - "body": json.dumps(response["Item"]) + "body": json.dumps(item) } diff --git a/backend/lambdas/post_config/main.py b/backend/lambdas/post_config/main.py index 2db3958..22e6395 100644 --- a/backend/lambdas/post_config/main.py +++ b/backend/lambdas/post_config/main.py @@ -32,7 +32,7 @@ def lambda_handler(event, context): }) } - body = json.loads(event.get("body", "{}")) + body = event.get("body", {}) keys = ["panel_title", "cafe_name", "cafe_id", "cafe_menu_id", "cafe_board_type"] @@ -68,11 +68,16 @@ def lambda_handler(event, context): } ) + item = { + key: str(value) if isinstance(value, str) else int(value) + for key, value in response["Item"].items() + } + return { "statusCode": "200", "headers": { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*' }, - "body": json.dumps(response) + "body": json.dumps(item) }