diff --git a/src/main/java/gymmi/service/WorkspaceService.java b/src/main/java/gymmi/service/WorkspaceService.java index 113879c..e588347 100644 --- a/src/main/java/gymmi/service/WorkspaceService.java +++ b/src/main/java/gymmi/service/WorkspaceService.java @@ -226,14 +226,21 @@ private void deleteTaskAndWorker(User loginedUser, Long workspaceId) { } public InsideWorkspaceResponse enterWorkspace(User logiendUser, Long workspaceId) { - validateIfWorkerIsInWorkspace(logiendUser.getId(), workspaceId); + Worker worker = validateIfWorkerIsInWorkspace(logiendUser.getId(), workspaceId); Workspace workspace = workspaceRepository.getWorkspaceById(workspaceId); List sortedWorkers = workerRepository.getAllByWorkspaceIdOrderByContributedScore(workspaceId); - List workerRanks = rankTied(sortedWorkers); + List workers = sortedWorkers.stream() + .filter(w -> !w.equals(worker)) + .toList(); + workers.add(0, worker); + + List workerRanks = rankTied(workers); + // hot-fix int achievementScore = workspaceRepository.getAchievementScore(workspaceId); + return InsideWorkspaceResponse.builder() .workspace(workspace) .achievementScore(achievementScore)