mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-03 10:19:14 +02:00
added UserDefined Module Naming
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"github.com/labstack/echo/v5"
|
||||
"github.com/pocketbase/pocketbase"
|
||||
"htwkalender/service/db"
|
||||
"htwkalender/service/functions"
|
||||
)
|
||||
|
||||
func GetModulesForCourseDistinct(app *pocketbase.PocketBase, c echo.Context, course string, semester string) error {
|
||||
@@ -19,9 +20,9 @@ func GetModulesForCourseDistinct(app *pocketbase.PocketBase, c echo.Context, cou
|
||||
}
|
||||
|
||||
func replaceEmptyEntryInStringArray(modules []string, replacement string) {
|
||||
//replace empty string with "Sonderveranstaltungen"
|
||||
//replace empty functions with "Sonderveranstaltungen"
|
||||
for i, module := range modules {
|
||||
if db.CheckIfOnlyWhitespace(module) {
|
||||
if functions.CheckIfOnlyWhitespace(module) {
|
||||
modules[i] = replacement
|
||||
}
|
||||
}
|
||||
@@ -31,9 +32,9 @@ func replaceEmptyEntry(modules []struct {
|
||||
Name string
|
||||
Course string
|
||||
}, replacement string) {
|
||||
//replace empty string with "Sonderveranstaltungen"
|
||||
//replace empty functions with "Sonderveranstaltungen"
|
||||
for i, module := range modules {
|
||||
if db.CheckIfOnlyWhitespace(module.Name) {
|
||||
if functions.CheckIfOnlyWhitespace(module.Name) {
|
||||
modules[i].Name = replacement
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user