Skip to content

Commit

Permalink
Revert "Add return questions, answers and followed tags to GET users/…
Browse files Browse the repository at this point in the history
…{userId}"

This reverts commit 490bcd6.
  • Loading branch information
Cgtycolak committed Dec 10, 2024
1 parent 490bcd6 commit 6d146ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,16 @@ public ResponseEntity<GenericApiResponse<SelfProfileResponseDto>> getUser() {
List<QuestionSummaryDto> questions = questionService.findByAuthorId(user.getId());
List<GetAnswerDtoForProfile> answers = answerService.findByAnsweredBy(user.getId());
selfProfileResponseDto.setFollowedTags(
tagService.getFollowedTags(user.getId()));
tagService.getFollowedTags(user.getId())
);
selfProfileResponseDto.setReputationPoints(userService.calculateReputation(user));
selfProfileResponseDto.setQuestionCount((long) questions.size());
selfProfileResponseDto.setQuestions(
questions);
questions);
selfProfileResponseDto.setAnswerCount((long) answers.size());
selfProfileResponseDto.setAnswers(
answers);
answers);


GenericApiResponse<SelfProfileResponseDto> response = ApiResponseBuilder.buildSuccessResponse(
selfProfileResponseDto.getClass(),
Expand Down Expand Up @@ -82,13 +84,10 @@ public ResponseEntity<GenericApiResponse<UserProfileResponseDto>> getUserById(
UserProfileResponseDto.class);
userProfileResponseDto.setReputationPoints(userService.calculateReputation(user.get()));
userProfileResponseDto.setSelfFollowing(userService.selfFollowing(user.get()));
List<QuestionSummaryDto> questions = questionService.findByAuthorId(id);
userProfileResponseDto.setQuestions(questions);
userProfileResponseDto.setQuestionCount((long) questions.size());
List<GetAnswerDtoForProfile> answers = answerService.findByAnsweredBy(id);
userProfileResponseDto.setAnswers(answers);
userProfileResponseDto.setAnswerCount((long) answers.size());
userProfileResponseDto.setFollowedTags(tagService.getFollowedTags(id));
userProfileResponseDto.setFollowedTags(
tagService.getFollowedTags(user.get().getId())
);


GenericApiResponse<UserProfileResponseDto> response = ApiResponseBuilder.buildSuccessResponse(
userProfileResponseDto.getClass(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package com.group1.programminglanguagesforum.DTOs.Responses;

import com.group1.programminglanguagesforum.Entities.ExperienceLevel;
import lombok.*;

Expand All @@ -26,7 +25,5 @@ public class UserProfileResponseDto {
private ExperienceLevel experienceLevel;
@Builder.Default
private List<SelfProfileResponseDto.FollowedTags> followedTags = new ArrayList<>();
private Long questionCount;
private List<QuestionSummaryDto> questions;
private List<GetAnswerDtoForProfile> answers;

}

0 comments on commit 6d146ac

Please sign in to comment.