diff --git a/server/src/main/java/server/haengdong/application/EventService.java b/server/src/main/java/server/haengdong/application/EventService.java index d0628c0ef..1aaddd0f9 100644 --- a/server/src/main/java/server/haengdong/application/EventService.java +++ b/server/src/main/java/server/haengdong/application/EventService.java @@ -152,7 +152,7 @@ private void validateAfterMemberNameNotExist(Event event, String afterName) { private void updateMemberName(Event event, String beforeName, String afterName) { memberActionRepository.findAllByAction_EventAndMemberName(event, beforeName) .forEach(memberAction -> memberAction.updateMemberName(afterName)); - billActionDetailRepository.findAllByMemberName(beforeName) + billActionDetailRepository.findAllByBillAction_Action_EventAndMemberName(event, beforeName) .forEach(billActionDetail -> billActionDetail.updateMemberName(afterName)); } diff --git a/server/src/main/java/server/haengdong/domain/action/BillActionDetailRepository.java b/server/src/main/java/server/haengdong/domain/action/BillActionDetailRepository.java index 17a082657..05de55304 100644 --- a/server/src/main/java/server/haengdong/domain/action/BillActionDetailRepository.java +++ b/server/src/main/java/server/haengdong/domain/action/BillActionDetailRepository.java @@ -4,6 +4,7 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; +import server.haengdong.domain.event.Event; @Repository public interface BillActionDetailRepository extends JpaRepository { @@ -15,5 +16,5 @@ public interface BillActionDetailRepository extends JpaRepository findAllByBillAction(BillAction billAction); - List findAllByMemberName(String memberName); + List findAllByBillAction_Action_EventAndMemberName(Event event, String memberName); }