mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-08-02 17:59:16 +02:00
fix:#150 removed unused function
This commit is contained in:
@@ -2,43 +2,18 @@ package v1
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/google/uuid"
|
||||||
|
"github.com/pocketbase/pocketbase/tools/types"
|
||||||
|
"golang.org/x/net/html"
|
||||||
"htwkalender/model"
|
"htwkalender/model"
|
||||||
"htwkalender/service/date"
|
"htwkalender/service/date"
|
||||||
"htwkalender/service/db"
|
|
||||||
"htwkalender/service/fetch"
|
"htwkalender/service/fetch"
|
||||||
"net/http"
|
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
|
||||||
"github.com/labstack/echo/v5"
|
|
||||||
"github.com/pocketbase/pocketbase"
|
|
||||||
"github.com/pocketbase/pocketbase/apis"
|
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
|
||||||
"golang.org/x/net/html"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetSeminarEvents(c echo.Context, app *pocketbase.PocketBase) error {
|
|
||||||
|
|
||||||
seminarGroupsLabel := db.GetAllCourses(app)
|
|
||||||
|
|
||||||
seminarGroups := GetSeminarGroupsEventsFromHTML(seminarGroupsLabel)
|
|
||||||
|
|
||||||
seminarGroups = ClearEmptySeminarGroups(seminarGroups)
|
|
||||||
|
|
||||||
seminarGroups = ReplaceEmptyEventNames(seminarGroups)
|
|
||||||
|
|
||||||
dbError, savedRecords := db.SaveSeminarGroupEvents(seminarGroups, app)
|
|
||||||
|
|
||||||
if dbError != nil {
|
|
||||||
return apis.NewNotFoundError("Events could not be saved", dbError.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
return c.JSON(http.StatusOK, savedRecords)
|
|
||||||
}
|
|
||||||
|
|
||||||
func ReplaceEmptyEventNames(groups []model.SeminarGroup) []model.SeminarGroup {
|
func ReplaceEmptyEventNames(groups []model.SeminarGroup) []model.SeminarGroup {
|
||||||
for i, group := range groups {
|
for i, group := range groups {
|
||||||
for j, event := range group.Events {
|
for j, event := range group.Events {
|
||||||
|
Reference in New Issue
Block a user