@@ -164,8 +164,6 @@ public Columns createColumn(String title, Integer navigationId) {
164164
165165 @ Override
166166 public void createApplicantBoard (String applicantId , String hopeField , Long cardId ) {
167- // \"hopeField\" -> hopeField 로 변경
168- hopeField = hopeField ;
169167 Integer year = latestRecruitmentVo .getYear ();
170168 if (hopeField .equals ("개발자" ) || hopeField .equals ("디자이너" ) || hopeField .equals ("기획자" )) {
171169 log .info ("ApplicantBoard 생성 : {}, applicantId : {}" , hopeField , applicantId );
@@ -176,6 +174,9 @@ public void createApplicantBoard(String applicantId, String hopeField, Long card
176174
177175 Columns column = columnLoadPort .getColumnByYearAndTitle (hopeField , year );
178176
177+ // 기존에 null 인 nextBoardId를 현재 boardId로 업데이트
178+ List <Board > existingBoards =
179+ boardLoadPort .getBoardByNavigationIdAndColumnsId (1 , column .getId ());
179180 Board board =
180181 Board .builder ()
181182 .cardType (CardType .APPLICANT )
@@ -185,14 +186,15 @@ public void createApplicantBoard(String applicantId, String hopeField, Long card
185186 .cardId (cardId )
186187 .build ();
187188 Board save = boardRecordPort .save (board );
188- // 기존에 null 인 nextBoardId를 현재 boardId로 업데이트
189- boardLoadPort .getBoardByNavigationIdAndColumnsId (1 , column .getId ()).stream ()
190- .filter (b -> b .getNextBoardId () == null )
191- .findFirst ()
192- .ifPresent (
193- b -> {
194- b .updateNextBoardID (save .getId ());
195- });
189+ if (!existingBoards .isEmpty ()) {
190+ existingBoards .stream ()
191+ .filter (b -> b .getNextBoardId () == null )
192+ .findFirst ()
193+ .ifPresent (
194+ b -> {
195+ b .updateNextBoardID (save .getId ());
196+ });
197+ }
196198 }
197199
198200 @ Override
0 commit comments