Skip to content

Commit

Permalink
🐛 [FIX] UserId를 통해 문서 추출 -> kakaoId로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
20210815 committed Dec 7, 2024
1 parent 9f76085 commit b0f45bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
public class DocumentIssuedController implements DocumentAPI {
public final DocumentIssuedService documentIssuedService;

@GetMapping("/{documentType}")
@GetMapping("/{documentType}/userId")
public ResponseEntity<ResponseDTO<?>> getDocumentIssuedList(@PathVariable String documentType, @AuthenticationPrincipal CustomUserDetails user) {
System.out.println(user.getUsername());
List<ResponseDocumentDTO> list = documentIssuedService.getDocumentIssuedList(user.getUsername(), documentType);
return ResponseEntity
.status(SuccessCode.SUCCESS_RETRIEVE_ACTIVITY_LIST.getStatus().value())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public List<ResponseDocumentDTO> getDocumentIssuedList(String kakaoId, String do
User user = userRepository.findByKakaoId(kakaoId)
.orElseThrow(() -> new UsernameNotFoundException("사용자를 찾을 수 없습니다."));

List<VolunteerListDTO> list= certificateService.getVolunteerSessionsByUserIdAndType(documentType, user.getId().toString());
List<VolunteerListDTO> list= certificateService.getVolunteerSessionsByUserIdAndType(documentType, kakaoId);
return list.stream().map((volunteerListDTO -> {
Volunteer volunteer = volunteerRepository.getReferenceById(Long.valueOf(volunteerListDTO.getVolunteerSessionsId()));
return ResponseDocumentDTO.builder()
Expand Down

0 comments on commit b0f45bd

Please sign in to comment.