Merged in fix/sw-1248-sort-unavailable-rooms (pull request #1126)

fix(SW-1248): show unavailable rooms last

* fix(SW-1248): show unavailable rooms last


Approved-by: Hrishikesh Vaipurkar
This commit is contained in:
Niclas Edenvin
2025-01-07 08:35:42 +00:00
parent dca02b90f0
commit b5b59329f4
2 changed files with 22 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ import type { RoomConfiguration } from "@/server/routers/hotels/output"
export function filterDuplicateRoomTypesByLowestPrice(
roomConfigurations: RoomConfiguration[]
) {
): RoomConfiguration[] {
const roomTypeCount = roomConfigurations.reduce(
(acc, room) => {
acc[room.roomType] = (acc[room.roomType] || 0) + 1