From a1fb0cae8a3bf4acda3557841350edf4ff777628 Mon Sep 17 00:00:00 2001 From: halil Date: Mon, 16 Dec 2024 21:13:50 +0300 Subject: [PATCH] hotfix: resolve follower id issue --- frontend/src/service/profileService.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/service/profileService.js b/frontend/src/service/profileService.js index f29db020..14a79dbd 100644 --- a/frontend/src/service/profileService.js +++ b/frontend/src/service/profileService.js @@ -44,6 +44,14 @@ const ProfileService = { async fetchProfileById(id) { try { const userData = await this.fetchUserById(id); + // Convert followers and following from porfile id to user id + userData.following = await Promise.all( + userData.following.map(async (profileId) => await this.userIdByProfileId(profileId)) + ); + userData.followers = await Promise.all( + userData.followers.map(async (profileId) => await this.userIdByProfileId(profileId)) + ); + const posts = await this.fetchPostsByProfileId(id); const transformedPosts = await Promise.all(