~kvo/taskcollect-devel

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

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

 1 files changed, 4 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~kvo/taskcollect-devel/patches/55361/mbox | git am -3
Learn more about email & git

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

+ 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)
Thanks!

To ssh://git@git.sr.ht/~kvo/taskcollect
   cead44b..a8a9aba  main -> main