|
|
|
@@ -500,9 +500,8 @@ open class ProjectsService( |
|
|
|
open fun allBuildingTypes(): List<BuildingType> { |
|
|
|
val sortedBuildingType = buildingTypeRepository.findAll().sortedBy { it.name }.sortedWith { a, b -> |
|
|
|
when { |
|
|
|
a.contains("Hidden", ignoreCase = true) && !b.contains("Hidden", ignoreCase = true) -> 2 |
|
|
|
a.startsWith("Others") && !b.startsWith("Others") -> 1 // Move "Others" to the end |
|
|
|
(!a.startsWith("Others") && b.startsWith("Others")) || (!a.contains("Hidden", ignoreCase = true) && b.contains("Hidden", ignoreCase = true)) -> -1 // Keep non-"Others" items above |
|
|
|
(!a.startsWith("Others") && b.startsWith("Others")) -> -1 // Keep non-"Others" items above |
|
|
|
else -> 0 // Maintain relative order for other items |
|
|
|
} |
|
|
|
} |
|
|
|
|