Skip to content

Commit

Permalink
fix: return modifiable list
Browse files Browse the repository at this point in the history
  • Loading branch information
aiaiaiai1 committed Jul 24, 2024
1 parent 466fae3 commit 4195bc4
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/main/java/gymmi/service/WorkspaceService.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.stream.Collectors;

@Service
@RequiredArgsConstructor
Expand Down Expand Up @@ -234,20 +235,9 @@ public InsideWorkspaceResponse enterWorkspace(User logiendUser, Long workspaceId

int achievementScore = workspaceRepository.getAchievementScore(workspaceId);


if (sortedWorkers.size() == 1) {
return InsideWorkspaceResponse.builder()
.workspace(workspace)
.achievementScore(achievementScore)
.sortedWorkers(sortedWorkers)
.workerRanks(workerRanks)
.loginedUser(logiendUser)
.build();
}

List<Worker> workers = sortedWorkers.stream()
.filter(w -> (!w.equals(worker)))
.toList();
.collect(Collectors.toList());
workers.add(0, worker);

// 랭크 로직은 수정해야할듯.
Expand Down

0 comments on commit 4195bc4

Please sign in to comment.