Skip to content

Commit

Permalink
fix : 어드민 해커톤 신청 api response 트랜잭션 외부에서 동작해서 part 못불러오는 이슈 해결 (#134) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
seulgi99 authored Jun 30, 2024
1 parent f0ac47d commit 7202f63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
import io.swagger.v3.oas.annotations.tags.Tag;
import javax.validation.Valid;
import likelion.univ.common.response.PageResponse;
import likelion.univ.domain.hackathon.entity.HackathonForm;
import likelion.univ.domain.hackathon.response.HackathonFormFindResponse;
import likelion.univ.domain.hackathon.service.HackathonService;
import likelion.univ.hackathon.dto.request.HackathonFormSearchRequest;
import likelion.univ.response.SuccessResponse;
import lombok.RequiredArgsConstructor;
import org.springdoc.api.annotations.ParameterObject;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
Expand All @@ -31,7 +29,7 @@ public SuccessResponse<PageResponse<HackathonFormFindResponse>> searchHackathons
@ParameterObject @Valid HackathonFormSearchRequest request,
@ParameterObject Pageable pageable
) {
Page<HackathonForm> result = hackathonService.search(request.toCondition(), pageable);
return SuccessResponse.of(PageResponse.of(result.map(HackathonFormFindResponse::from)));
PageResponse<HackathonFormFindResponse> result = hackathonService.search(request.toCondition(), pageable);
return SuccessResponse.of(result);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package likelion.univ.domain.hackathon.service;

import java.util.List;
import likelion.univ.common.response.PageResponse;
import likelion.univ.domain.hackathon.entity.Hackathon;
import likelion.univ.domain.hackathon.entity.HackathonForm;
import likelion.univ.domain.hackathon.exception.AlreadyAppliedHackathonException;
Expand Down Expand Up @@ -71,8 +72,8 @@ public void modify(HackathonModifyCommand command) {
);
}

public Page<HackathonForm> search(HackathonFormSearchCondition condition, Pageable pageable) {
public PageResponse<HackathonFormFindResponse> search(HackathonFormSearchCondition condition, Pageable pageable) {
Page<HackathonForm> result = hackathonFormRepository.search(condition, pageable);
return result;
return PageResponse.of(result.map(HackathonFormFindResponse::from));
}
}

0 comments on commit 7202f63

Please sign in to comment.