Skip to content

Commit

Permalink
Merge pull request #86 from teamterning/feat/#82
Browse files Browse the repository at this point in the history
[🔨 fix/#82]: 필터링 재설정 로직 오류 수정
  • Loading branch information
JungYoonShin authored Jul 18, 2024
2 parents 76a88a5 + 27bbd6a commit 0b9bb07
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public ResponseEntity<SuccessResponse> updateUserFilter(
@AuthenticationPrincipal Long userId,
@RequestBody UserFilterRequestDto requestDto) {
filterService.updateUserFilter(requestDto, userId);
return ResponseEntity.ok(SuccessResponse.of(SUCCESS_UPDATE_SCRAP));
return ResponseEntity.ok(SuccessResponse.of(SUCCESS_UPDATE_USER_FILTER));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ public UserFilterResponseDto getUserFilter(Long userId) {
public void updateUserFilter(UserFilterRequestDto responseDto, Long userId) {
User user = findUser(userId);
Filter filter = user.getFilter();

filter.updateFilter(
Grade.fromKey(responseDto.grade()),
WorkingPeriod.fromKey(responseDto.workingPeriod()),
responseDto.startYear(),
responseDto.startMonth()
);
System.out.println("filter = " + filter);
if(filter != null){
filter.updateFilter(
Grade.fromKey(responseDto.grade()),
WorkingPeriod.fromKey(responseDto.workingPeriod()),
responseDto.startYear(),
responseDto.startMonth()
);
}
}

private User findUser(Long userId) {
Expand Down

0 comments on commit 0b9bb07

Please sign in to comment.