Skip to content

Commit

Permalink
fix: Ensure ordering of library floors (#1355)
Browse files Browse the repository at this point in the history
  • Loading branch information
thePeras authored Oct 25, 2024
2 parents 6c6e66d + 6c5c83f commit a75b100
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class LibraryOccupationFetcher {
}),
);

libraryOccupation.sortFloors();
return libraryOccupation;
}

Expand Down
4 changes: 4 additions & 0 deletions packages/uni_app/lib/model/entities/library_occupation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ class LibraryOccupation {
return floors[number - 1];
}

void sortFloors() {
floors.sort((a, b) => a.number.compareTo(b.number));
}

Map<String, dynamic> toJson() => _$LibraryOccupationToJson(this);
}

Expand Down

0 comments on commit a75b100

Please sign in to comment.