Skip to content

Commit

Permalink
feat : 어드민 동아리 이미지 없앰
Browse files Browse the repository at this point in the history
  • Loading branch information
Changha-dev committed Nov 25, 2023
1 parent 27a68a5 commit cb4ef91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ public ResponseEntity rejectClubJoin(@RequestParam Long memberId, @RequestParam
}

@PutMapping("/clubs/{id}")
public ResponseEntity updateSelecetedClub(@PathVariable("id") Long clubId, @RequestPart("ImageClub") MultipartFile imageFile, @RequestPart("ClubProfileUpdateDto") ClubProfileUpdateDto clubProfileUpdateDto){
public ResponseEntity updateSelecetedClub(@PathVariable("id") Long clubId, @RequestPart("ClubProfileUpdateDto") ClubProfileUpdateDto clubProfileUpdateDto){

ResponseDto responseDto = adminService.updateClubDetails(clubId, clubProfileUpdateDto, imageFile);
ResponseDto responseDto = adminService.updateClubDetails(clubId, clubProfileUpdateDto);

return ResponseEntity.ok(responseDto);
}
Expand Down
19 changes: 8 additions & 11 deletions src/main/java/com/donggram/back/service/AdminService.java
Original file line number Diff line number Diff line change
Expand Up @@ -277,26 +277,23 @@ public ResponseDto getAllMemberBySelectedClub(Long clubRequestId){
}

@Transactional
public ResponseDto updateClubDetails(Long clubRequestId, ClubProfileUpdateDto clubProfileUpdateDto, MultipartFile multipartFile){
public ResponseDto updateClubDetails(Long clubRequestId, ClubProfileUpdateDto clubProfileUpdateDto){
ClubRequest clubRequest = clubRequestRepository.findById(clubRequestId).orElseThrow(() -> new RuntimeException("해당 동아리생성 엔티티가 존재하지 않습니다."));

Club club = clubRequest.getClub();

club.updateClubProfile(clubProfileUpdateDto, collegeRepository, divisionRepository);

System.out.println("1111111111111111");

ImageClub imageClub = imageClubRepository.findByClubId(club.getId()).orElseThrow(() -> new RuntimeException("해당 동아리이미지 엔티티가 존재하지 않습니다."));
// ImageClub imageClub = imageClubRepository.findByClubId(club.getId()).orElseThrow(() -> new RuntimeException("해당 동아리이미지 엔티티가 존재하지 않습니다."));


if (!multipartFile.isEmpty() && multipartFile != null){
System.out.println("akdljf,x.cnvklzcjiajgi;e");
String updateImageUrl = uploadImage(multipartFile, clubRequest);
imageClub.uploadCustomImage(updateImageUrl);
} else {
System.out.println("imageProfile Null");
imageClub.uploadCustomImage(club.getImageClub().getUrl());
}
// if (!multipartFile.isEmpty() && multipartFile != null){
// String updateImageUrl = uploadImage(multipartFile, clubRequest);
// imageClub.uploadCustomImage(updateImageUrl);
// } else {
// imageClub.uploadCustomImage(club.getImageClub().getUrl());
// }

ClubDetailsDto clubDetailsDto = ClubDetailsDto.builder()
.clubId(club.getId())
Expand Down

0 comments on commit cb4ef91

Please sign in to comment.