Skip to content

Commit

Permalink
chore: portfolio update method fix
Browse files Browse the repository at this point in the history
  • Loading branch information
daeun084 committed Feb 18, 2024
1 parent ec74989 commit f8f25c7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,15 @@ public void updatePortfolio(UpdatePortfolioDto dto) {
Portfolio portfolio = portfolioRepository.findById(dto.getPortfolioId())
.orElseThrow(() -> new GlobalException(ErrorStatus.NOT_EXIST_PORTFOLIO));

if(portfolio.isBlock() && !dto.getIsBlock())
if(portfolio.isBlock() && dto.getIsBlock())
throw new GlobalException(ErrorStatus.BLOCKED_PORTFOLIO);

if (!portfolio.getArtist().equals(artist)) {
throw new GlobalException(ErrorStatus.NOT_AUTHORIZED_PORTFOLIO);
}

updatePortfolioImg(portfolio, dto.getPortfolioImgList()); // 수정
if(!dto.getPortfolioImgList().isEmpty())
updatePortfolioImg(portfolio, dto.getPortfolioImgList()); // 수정

portfolio.updatePortfolio(dto);
}
Expand Down

0 comments on commit f8f25c7

Please sign in to comment.