diff --git a/backend/db/crud.py b/backend/db/crud.py index 0910e780699224a206f43b05adbec442f3ba9e48..d9b16536e60df5f6a8189ebd216b5b4324491599 100644 --- a/backend/db/crud.py +++ b/backend/db/crud.py @@ -44,7 +44,8 @@ def add_slot(slots_list, start_time, end_time, function): average_waiting_time = function(start_time, end_time) if average_waiting_time: name = 60 * start_time.hour + start_time.minute - slots_list.append(schemas.RecordRead(name=name, time=average_waiting_time)) + slots_list.append(schemas.RecordRead( + name=name, time=average_waiting_time)) def get_avg_graph_points(place: str, weekday: int, min_time: time, @@ -260,8 +261,11 @@ def get_restaurants(db: Session): restaurants = [] for place in places: - opening_hours = db.query(models.OpeningHours).filter( - models.OpeningHours.place == place.place, models.OpeningHours.day == weekday).all() + opening_hours = db.query( + models.OpeningHours).filter( + models.OpeningHours.place == place.place, + models.OpeningHours.day == weekday).order_by( + models.OpeningHours.open_time).all() opening_hours_formated = [ f"{row.open_time.strftime('%Hh%M')}-{row.close_time.strftime('%Hh%M')}" for row in opening_hours] timetable = "/".join(opening_hours_formated) diff --git a/frontend/src/styles/Comments.css b/frontend/src/styles/Comments.css index 1fdfc1e9098d2d040173f8b93c0f60601546ff3a..d52fe85b8f500b3991b1773e839b72127013b9d7 100644 --- a/frontend/src/styles/Comments.css +++ b/frontend/src/styles/Comments.css @@ -129,7 +129,7 @@ top: 0; height: 3rem; width: 3rem; - margin: 1rem; + margin: 0.5rem; padding: 0.5rem; border-radius: 5px; }