mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-07-16 09:38:51 +02:00
refactoring
This commit is contained in:
@ -34,7 +34,7 @@ func addRoutes(app *pocketbase.PocketBase) {
|
||||
Method: http.MethodGet,
|
||||
Path: "/api/fetchGroups",
|
||||
Handler: func(c echo.Context) error {
|
||||
return service.FetchSeminarGroups(c, app)
|
||||
return service.FetchSeminarGroups(c)
|
||||
},
|
||||
Middlewares: []echo.MiddlewareFunc{
|
||||
apis.ActivityLogger(app),
|
||||
|
@ -8,7 +8,6 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v5"
|
||||
"github.com/pocketbase/pocketbase"
|
||||
)
|
||||
|
||||
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()
|
||||
|
||||
|
@ -117,9 +117,9 @@ func toEvents(tables [][]*html.Node, days []string) []model.Events {
|
||||
return events
|
||||
}
|
||||
|
||||
func toUtf8(iso8859_1_buf []byte) string {
|
||||
buf := make([]rune, len(iso8859_1_buf))
|
||||
for i, b := range iso8859_1_buf {
|
||||
func toUtf8(iso88591Buf []byte) string {
|
||||
buf := make([]rune, len(iso88591Buf))
|
||||
for i, b := range iso88591Buf {
|
||||
buf[i] = rune(b)
|
||||
}
|
||||
return string(buf)
|
||||
|
Reference in New Issue
Block a user