Skip to content

Commit

Permalink
fix: createMission completeMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
char-yb committed Aug 30, 2024
1 parent 05e65e6 commit 66cbfa4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ public class MissionService {

public MissionCreateResponse createMission(MissionCreateRequest missionCreateRequest) {
Mission mission =
Mission.builder()
.title(missionCreateRequest.title())
.raisePet(missionCreateRequest.raisePet())
.build();
Mission.createMission(
missionCreateRequest.title(),
missionCreateRequest.raisePet(),
missionCreateRequest.completeMessage());

mission = missionRepository.save(mission);
return MissionCreateResponse.from(mission);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ public Mission(String title, RaisePet raisePet, String completeMessage) {
this.completeMessage = completeMessage;
}

public static Mission createMission(String title, RaisePet raisePet, String completeMessage) {
return Mission.builder()
.title(title)
.raisePet(raisePet)
.completeMessage(completeMessage)
.build();
}

public void updateTitle(String title) {
this.title = title;
}
Expand Down

0 comments on commit 66cbfa4

Please sign in to comment.