mirror of
https://codeberg.org/JasterV/spazio-solazzo.git
synced 2026-04-26 18:20:03 +00:00
fix: sort time slots by start day when displaying them
This commit is contained in:
parent
72a1cbc662
commit
90a35607a9
1 changed files with 13 additions and 10 deletions
|
|
@ -134,15 +134,18 @@ defmodule SpazioSolazzoWeb.SpaceBookingLive do
|
|||
end
|
||||
|
||||
defp load_time_slots_with_stats(space, date, current_user) do
|
||||
BookingSystem.get_space_time_slots_by_date!(space.id, date,
|
||||
load: [
|
||||
booking_stats: %{
|
||||
date: date,
|
||||
space_id: space.id,
|
||||
capacity: space.capacity,
|
||||
user_id: current_user.id
|
||||
}
|
||||
]
|
||||
)
|
||||
time_slots =
|
||||
BookingSystem.get_space_time_slots_by_date!(space.id, date,
|
||||
load: [
|
||||
booking_stats: %{
|
||||
date: date,
|
||||
space_id: space.id,
|
||||
capacity: space.capacity,
|
||||
user_id: current_user.id
|
||||
}
|
||||
]
|
||||
)
|
||||
|
||||
Enum.sort_by(time_slots, fn slot -> slot.start_time end)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue