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
|
end
|
||||||
|
|
||||||
defp load_time_slots_with_stats(space, date, current_user) do
|
defp load_time_slots_with_stats(space, date, current_user) do
|
||||||
BookingSystem.get_space_time_slots_by_date!(space.id, date,
|
time_slots =
|
||||||
load: [
|
BookingSystem.get_space_time_slots_by_date!(space.id, date,
|
||||||
booking_stats: %{
|
load: [
|
||||||
date: date,
|
booking_stats: %{
|
||||||
space_id: space.id,
|
date: date,
|
||||||
capacity: space.capacity,
|
space_id: space.id,
|
||||||
user_id: current_user.id
|
capacity: space.capacity,
|
||||||
}
|
user_id: current_user.id
|
||||||
]
|
}
|
||||||
)
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
Enum.sort_by(time_slots, fn slot -> slot.start_time end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue