From ea3dff40c54623136e3fae42064b459967aa4865 Mon Sep 17 00:00:00 2001 From: "Y.H LIEN" <85728908+LIEN-YUHSIANG@users.noreply.github.com> Date: Mon, 16 Oct 2023 23:05:51 +0900 Subject: [PATCH] feat: implement forum comment author new (#356) --- src/lambda/get-comments/index.py | 3 ++- src/lambda/get-comments/utils.py | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lambda/get-comments/index.py b/src/lambda/get-comments/index.py index 09dbd625e..5324ebdb8 100644 --- a/src/lambda/get-comments/index.py +++ b/src/lambda/get-comments/index.py @@ -14,7 +14,8 @@ def get_comments(thread_id, uid=""): r["mod"] = False if r["uid"] == uid: r["mod"] = True - r["uid"] = uid_encoder(uid) + del r["uid"] + r["uid_mod"] = uid_encoder(uid) body = JsonPayloadBuilder().add_status( True).add_data(results).add_message('').compile() diff --git a/src/lambda/get-comments/utils.py b/src/lambda/get-comments/utils.py index c3711632b..7cabefe64 100644 --- a/src/lambda/get-comments/utils.py +++ b/src/lambda/get-comments/utils.py @@ -42,8 +42,7 @@ def uid_encoder(uid): :return: Sha256 encoded uid """ hashed_uid = hashlib.sha256(uid.encode()).hexdigest() - transformed_uid = hashed_uid - # transformed_uid = hashed_uid[:6] #! Might cause collision if shorten it + transformed_uid = hashed_uid[:6] return transformed_uid