fix:#36 fixed tests, naming, and removed old duplicated code

This commit is contained in:
Elmar Kresse
2024-06-18 18:53:29 +02:00
parent 75752d3fb1
commit 4792b07e8c
8 changed files with 9 additions and 566 deletions

View File

@@ -18,6 +18,7 @@ package db
import (
"fmt"
"github.com/google/uuid"
"github.com/pocketbase/pocketbase/daos"
"github.com/pocketbase/pocketbase/tools/types"
"htwkalender/data-manager/model"
@@ -138,11 +139,11 @@ func buildIcalQueryForModules(modulesUuid []string) dbx.Expression {
// following the pattern of only containing alphanumeric characters and dashes
for _, moduleUuid := range modulesUuid {
if !IsSafeIdentifier(moduleUuid) {
err := uuid.Validate(moduleUuid)
if err != nil {
slog.Warn("Module UUID is not safe: ", "moduleUuid", moduleUuid)
return dbx.HashExp{}
}
}
// build where conditions for each module