From 72382a3c6a5619950f5a25f9a143a3f1a3fbce11 Mon Sep 17 00:00:00 2001 From: masterelmar <18119527+masterElmar@users.noreply.github.com> Date: Wed, 16 Aug 2023 09:15:00 +0200 Subject: [PATCH] refactoring --- addRoute.go | 2 +- service/fetchSeminarGroupService.go | 3 +-- service/fetchService.go | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/addRoute.go b/addRoute.go index a350f5c..130c8f0 100644 --- a/addRoute.go +++ b/addRoute.go @@ -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), diff --git a/service/fetchSeminarGroupService.go b/service/fetchSeminarGroupService.go index 7273133..02de4d3 100644 --- a/service/fetchSeminarGroupService.go +++ b/service/fetchSeminarGroupService.go @@ -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() diff --git a/service/fetchService.go b/service/fetchService.go index f43e513..383acfd 100644 --- a/service/fetchService.go +++ b/service/fetchService.go @@ -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)