From d89a58f809abbb557ed036a7a89c2827f9ae5d65 Mon Sep 17 00:00:00 2001 From: Rykkel <220993G@mymail.nyp.edu.sg> Date: Mon, 12 Aug 2024 18:33:28 +0800 Subject: [PATCH] Retrieve comment pfp & name --- client/src/components/CommentsModule.tsx | 20 +++++++++++++++----- server/models/Comment.js | 2 ++ server/routes/post.js | 1 + 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/client/src/components/CommentsModule.tsx b/client/src/components/CommentsModule.tsx index 547135f..65d8db2 100644 --- a/client/src/components/CommentsModule.tsx +++ b/client/src/components/CommentsModule.tsx @@ -24,6 +24,11 @@ export default function CommentsModule() { let postId = id + // Function to get the profile picture URL + const getProfilePicture = (userId: string): string => { + return `${config.serverAddress}/users/profile-image/${userId}`; + }; + const getComments = async () => { instance .get(config.serverAddress + `/post/${postId}/getComments`).then((res) => { @@ -47,21 +52,26 @@ export default function CommentsModule() {