From d59a55f8c305767203f3ce49fcba892932d476b3 Mon Sep 17 00:00:00 2001 From: Ruidy Date: Mon, 26 Aug 2024 21:33:41 +0200 Subject: [PATCH] improve item sorting --- internal/server/handle_bookings.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/server/handle_bookings.go b/internal/server/handle_bookings.go index cc97442..c7b3b5d 100644 --- a/internal/server/handle_bookings.go +++ b/internal/server/handle_bookings.go @@ -139,13 +139,13 @@ func handleBookingPage(bs *booking.Service, hc *config.Host) echo.HandlerFunc { return sum + i.Price*float64(i.Quantity) }, 0.0), 'f', 2, 64), Platforms: hc.Platforms, - ItemList: u.OrderBy(func(items map[string]config.HostItem) (out []string) { + ItemList: u.OrderBy(func(items map[string]config.HostItem) (out []string) { // TODO: return the full item to prefill the form for _, item := range items { out = append(out, item.Name) } return out }(hc.Items), - func(l, r string) bool { return l < r }, + func(l, r string) bool { return l > r }, ), PaymentMethods: hc.PaymentMethods, }