refactoring

This commit is contained in:
masterelmar
2023-08-16 09:15:00 +02:00
parent f92659d06f
commit 72382a3c6a
3 changed files with 5 additions and 6 deletions

View File

@ -34,7 +34,7 @@ func addRoutes(app *pocketbase.PocketBase) {
Method: http.MethodGet, Method: http.MethodGet,
Path: "/api/fetchGroups", Path: "/api/fetchGroups",
Handler: func(c echo.Context) error { Handler: func(c echo.Context) error {
return service.FetchSeminarGroups(c, app) return service.FetchSeminarGroups(c)
}, },
Middlewares: []echo.MiddlewareFunc{ Middlewares: []echo.MiddlewareFunc{
apis.ActivityLogger(app), apis.ActivityLogger(app),

View File

@ -8,7 +8,6 @@ import (
"net/http" "net/http"
"github.com/labstack/echo/v5" "github.com/labstack/echo/v5"
"github.com/pocketbase/pocketbase"
) )
func getSeminarHTML() (string, error) { func getSeminarHTML() (string, error) {
@ -39,7 +38,7 @@ func getSeminarHTML() (string, error) {
} }
func FetchSeminarGroups(c echo.Context, app *pocketbase.PocketBase) error { func FetchSeminarGroups(c echo.Context) error {
result, _ := getSeminarHTML() result, _ := getSeminarHTML()

View File

@ -117,9 +117,9 @@ func toEvents(tables [][]*html.Node, days []string) []model.Events {
return events return events
} }
func toUtf8(iso8859_1_buf []byte) string { func toUtf8(iso88591Buf []byte) string {
buf := make([]rune, len(iso8859_1_buf)) buf := make([]rune, len(iso88591Buf))
for i, b := range iso8859_1_buf { for i, b := range iso88591Buf {
buf[i] = rune(b) buf[i] = rune(b)
} }
return string(buf) return string(buf)