mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-07-16 17:48:51 +02:00
refactoring
This commit is contained in:
@ -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),
|
||||||
|
@ -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()
|
||||||
|
|
||||||
|
@ -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)
|
||||||
|
Reference in New Issue
Block a user