mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-02 17:59:14 +02:00
fix:#150 removed unused function
This commit is contained in:
@@ -2,43 +2,18 @@ package v1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/google/uuid"
|
||||
"github.com/pocketbase/pocketbase/tools/types"
|
||||
"golang.org/x/net/html"
|
||||
"htwkalender/model"
|
||||
"htwkalender/service/date"
|
||||
"htwkalender/service/db"
|
||||
"htwkalender/service/fetch"
|
||||
"net/http"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"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 {
|
||||
for i, group := range groups {
|
||||
for j, event := range group.Events {
|
||||
|
Reference in New Issue
Block a user