Move away from dbmate, use PolySchema

This commit is contained in:
Jamie Curnow committed 2026-09-28 11:31:27 +10:00
1 parent 52399c42f1
commit 2a14f3f84c
99 files changed
+1583 -1691

No files matched your search

+1 -1
View File
@@ -70,7 +70,7 @@ func Enforce(permissions ...string) func(http.Handler) http.Handler {
var userCapabilities []string
if found {
userCapabilities = cacheItem.([]string)
userCapabilities, _ = cacheItem.([]string)
} else {
// Get from db and store it
userCapabilities, err = user.GetCapabilities(userID)
@@ -27,7 +27,7 @@ func TestBodyContext(t *testing.T) {
// Create a test handler that checks the context for the body data
handler := http.HandlerFunc(func(_ http.ResponseWriter, r *http.Request) {
bodyData := r.Context().Value(c.BodyCtxKey).([]byte)
bodyData, _ := r.Context().Value(c.BodyCtxKey).([]byte)
assert.Equal(t, body, bodyData)
})
@@ -58,16 +58,13 @@ func listQuerySort(
return ctx, 0, ""
}
// Split sort fields up in to slice
sorts := strings.Split(sortString, ",")
for _, sortItem := range sorts {
// Split sort fields up
for sortItem := range strings.SplitSeq(sortString, ",") {
if strings.Contains(sortItem, ".") {
theseItems := strings.Split(sortItem, ".")
switch strings.ToLower(theseItems[1]) {
case "desc":
fallthrough
case "descending":
case "desc", "descending":
theseItems[1] = "DESC"
default:
theseItems[1] = "ASC"
+2 -2
View File
@@ -38,8 +38,8 @@ func SSEAuth(next http.Handler) http.Handler {
return
}
iss, _ := token.Get("iss")
if iss != "sse" {
iss, ok := token.Issuer()
if !ok || iss != "sse" {
h.ResultErrorJSON(w, r, http.StatusUnauthorized, "Unauthorised", nil)
return
}