diff --git a/frontend/src/service/profileService.js b/frontend/src/service/profileService.js index 98b05150..f29db020 100644 --- a/frontend/src/service/profileService.js +++ b/frontend/src/service/profileService.js @@ -2,7 +2,7 @@ import { apiClient } from './apiClient'; import log from '../utils/logger'; import { transformPost } from './postService'; -const transformProfile = (userData, profile, posts, comments, portfolios) => { +const transformProfile = (userData, profile, posts, comments) => { profile = { ...profile, username: userData.username, @@ -10,12 +10,10 @@ const transformProfile = (userData, profile, posts, comments, portfolios) => { name: "Not Set", posts: posts, comments: comments, - portfolios: portfolios, followingCnt: profile?.following?.length || 0, followersCnt: profile?.followers?.length || 0, postsCnt: posts.length || 0, commentsCnt: comments.length || 0, - portfoliosCnt: portfolios.length || 0, }; return profile; }; @@ -52,10 +50,9 @@ const ProfileService = { posts.map(async (post) => transformPost(post)) ); const comments = await this.fetchCommentsByProfileId(id); - const portfolios = await this.fetchPortfoliosByProfileId(id); const response = await apiClient.get(`/profiles/by-user-id/${id}/`); - return transformProfile(userData, response.data, transformedPosts, comments, portfolios); + return transformProfile(userData, response.data, transformedPosts, comments); } catch (error) { log.error(`Error fetching profile with ID ${id}:`, error); throw error;