~kvo/taskcollect-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] src/site/myadelaide/lessons.go: fixed an issue where listResp would not return a correctly sorted list of lessons.

Details
Message ID
<20241007070607.66845-1-xavier.tang109@gmail.com>
DKIM signature
pass
Download raw message
Patch: +4 -0
+ added a sort inside of listResp

Signed-off-by: Wasabi1092 <xavier.tang109@gmail.com>
---
 src/site/myadelaide/lessons.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/site/myadelaide/lessons.go b/src/site/myadelaide/lessons.go
index a285e2a..fe8a3b0 100644
--- a/src/site/myadelaide/lessons.go
+++ b/src/site/myadelaide/lessons.go
@@ -8,6 +8,7 @@ import (
	"strconv"
	"strings"
	"time"
	"sort"

	"git.sr.ht/~kvo/go-std/errors"
)
@@ -223,6 +224,9 @@ func listResp(user site.User) ([]site.Lesson, error) {
			})
		}
	}
	sort.Slice(lessons, func(i, j int) bool {
		return lessons[i].Start.Before(lessons[j].Start)
	})
	return lessons, nil
}

-- 
2.39.3 (Apple Git-145)
Details
Message ID
<D4PEBUIWRBF4.18N4P89DBFFNX@joybook>
In-Reply-To
<20241007070607.66845-1-xavier.tang109@gmail.com> (view parent)
DKIM signature
pass
Download raw message
Thanks!

To ssh://git@git.sr.ht/~kvo/taskcollect
   cead44b..a8a9aba  main -> main
Reply to thread Export thread (mbox)