Skip to content

Commit

Permalink
fix: Transactional 추가 및 StepResponse 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kunsanglee committed Jul 25, 2024
1 parent 123a23e commit 9eff30a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import server.haengdong.application.request.EventAppRequest;
import server.haengdong.application.response.ActionAppResponse;
import server.haengdong.application.response.EventAppResponse;
Expand All @@ -20,6 +21,7 @@
import server.haengdong.exception.HaengdongException;

@RequiredArgsConstructor
@Transactional(readOnly = true)
@Service
public class EventService {

Expand All @@ -28,6 +30,7 @@ public class EventService {
private final BillActionRepository billActionRepository;
private final MemberActionRepository memberActionRepository;

@Transactional
public EventAppResponse saveEvent(EventAppRequest request) {
String token = eventTokenProvider.createToken();
Event event = request.toEvent(token);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public static StepResponse of(List<ActionAppResponse> actions) {
}
if (currentActionType.equals("BILL")) {
actionsResponse.add(ActionsResponse.of(group, members));
} else {
actionsResponse.add(ActionsResponse.of(group, Set.of()));
}
currentActionType = typeName;
group.clear();
Expand All @@ -53,8 +51,6 @@ public static StepResponse of(List<ActionAppResponse> actions) {

if (currentActionType.equals("BILL")) {
actionsResponse.add(ActionsResponse.of(group, members));
} else {
actionsResponse.add(ActionsResponse.of(group, null));
}

return new StepResponse(actionsResponse);
Expand Down

0 comments on commit 9eff30a

Please sign in to comment.