diff --git a/src/main/java/land/leets/domain/portfolio/domain/repository/PortfolioRepository.java b/src/main/java/land/leets/domain/portfolio/domain/repository/PortfolioRepository.java index 0601db2..e5590d3 100644 --- a/src/main/java/land/leets/domain/portfolio/domain/repository/PortfolioRepository.java +++ b/src/main/java/land/leets/domain/portfolio/domain/repository/PortfolioRepository.java @@ -1,6 +1,5 @@ package land.leets.domain.portfolio.domain.repository; -import land.leets.domain.comment.domain.Comment; import land.leets.domain.portfolio.domain.Portfolio; import land.leets.domain.portfolio.domain.ProjectScope; import org.springframework.data.jpa.repository.JpaRepository; @@ -9,6 +8,6 @@ public interface PortfolioRepository extends JpaRepository { List findAllByGenerationAndScope(Long generation, ProjectScope scope); - List findAllByScope(ProjectScope scope); + List findAllByScopeOrderByGenerationDesc(ProjectScope scope); Portfolio findByPortfolioId(Long portfolioId); } \ No newline at end of file diff --git a/src/main/java/land/leets/domain/portfolio/usecase/GetPortfoliosImpl.java b/src/main/java/land/leets/domain/portfolio/usecase/GetPortfoliosImpl.java index 07abdae..7f23250 100644 --- a/src/main/java/land/leets/domain/portfolio/usecase/GetPortfoliosImpl.java +++ b/src/main/java/land/leets/domain/portfolio/usecase/GetPortfoliosImpl.java @@ -41,7 +41,7 @@ public PortfolioResponse one(Long portfolioId) { } private List getPortfoliosByScope(ProjectScope scope) { - return portfolioRepository.findAllByScope(scope).stream() + return portfolioRepository.findAllByScopeOrderByGenerationDesc(scope).stream() .map(portfolioMapper::mappingPortfolioToPortfoliosResponse) .toList(); }