diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/dto/res/GetMyFarmClubResponseDto.java b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/dto/res/GetMyFarmClubResponseDto.java index 0cf4187..2924083 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/dto/res/GetMyFarmClubResponseDto.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/dto/res/GetMyFarmClubResponseDto.java @@ -40,7 +40,8 @@ public static List createSteps(List stepVoList, List images = new ArrayList<>(); for (GetMissionPostListVo mission: missionList) { if (step.num() == mission.stepNum()) { - images.add(mission.image()); + if (!mission.isReported()) + images.add(mission.image()); count++; } } diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/repository/MissionPostRepositoryImpl.java b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/repository/MissionPostRepositoryImpl.java index 5207e67..e038e9d 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/repository/MissionPostRepositoryImpl.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/repository/MissionPostRepositoryImpl.java @@ -41,11 +41,12 @@ public List getMissionPostStepNumAndImage(Long userId, Lon .select(Projections.constructor( GetMissionPostListVo.class, missionPost.stepNum, - missionPost.image)) + missionPost.image, + missionPost.id.in(reportMissionPostIds))) .from(missionPost) .join(missionPost.userFarmClub, userFarmClub) .join(userFarmClub.farmClub, farmClub) - .where(farmClub.id.eq(farmClubId).and(missionPost.id.notIn(reportMissionPostIds))) + .where(farmClub.id.eq(farmClubId)) .fetch(); } diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/vo/GetMissionPostListVo.java b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/vo/GetMissionPostListVo.java index 4eb2f52..3af2bfe 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/vo/GetMissionPostListVo.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/vo/GetMissionPostListVo.java @@ -4,7 +4,8 @@ public record GetMissionPostListVo( int stepNum, - String image + String image, + Boolean isReported ) { @QueryProjection public GetMissionPostListVo {