Skip to content

Commit

Permalink
[ADD] added sorting filter
Browse files Browse the repository at this point in the history
  • Loading branch information
thguss committed Sep 2, 2024
1 parent 4968af3 commit 8abc4e2
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.soptie.server.api.controller.dto.response.memberroutine;

import java.util.Comparator;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -53,6 +54,7 @@ public static MemberRoutinesResponse of(Theme theme, Map<Routine, MemberRoutine>
private static List<MemberRoutineResponse> toRoutines(Map<Routine, MemberRoutine> routinesByMember) {
return routinesByMember.entrySet().stream()
.map(entry -> MemberRoutineResponse.of(entry.getKey(), entry.getValue()))
.sorted(Comparator.comparingLong(MemberRoutineResponse::routineId))
.toList();
}

Expand Down

0 comments on commit 8abc4e2

Please sign in to comment.