Skip to content

Commit

Permalink
hotfix: resolve follower id issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Halil-Ibrahim-Kasapoglu committed Dec 16, 2024
1 parent 883cb7a commit a1fb0ca
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/src/service/profileService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit a1fb0ca

Please sign in to comment.