Aktualisiere die Version auf 1.4.3, füge Validierung für Saison-Slugs hinzu und implementiere ein Logging-System für Fehler und Informationen
Some checks failed
Code Analysis and Production Deploy / analyze (push) Has been skipped
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Successful in 1m49s
Code Analysis and Production Deploy / analyze (pull_request) Failing after 2m37s
Code Analysis and Production Deploy / deploy-production (pull_request) Has been skipped
Code Analysis and Production Deploy / deploy-test (pull_request) Has been skipped
Require Package Version Change / check (pull_request) Failing after 8s
Some checks failed
Code Analysis and Production Deploy / analyze (push) Has been skipped
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Successful in 1m49s
Code Analysis and Production Deploy / analyze (pull_request) Failing after 2m37s
Code Analysis and Production Deploy / deploy-production (pull_request) Has been skipped
Code Analysis and Production Deploy / deploy-test (pull_request) Has been skipped
Require Package Version Change / check (pull_request) Failing after 8s
This commit is contained in:
@@ -1,8 +1,18 @@
|
||||
import { listSpielplanSeasons, readSpielplanData } from '../utils/spielplan-data.js'
|
||||
import { listSpielplanSeasons, readSpielplanData, validateSeasonSlug } from '../utils/spielplan-data.js'
|
||||
import { error as loggerError } from '../utils/logger.js'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
try {
|
||||
const query = getQuery(event)
|
||||
if (query.season && !validateSeasonSlug(query.season)) {
|
||||
loggerError('Ungueltiger Saison-Slug angefragt', { season: query.season })
|
||||
return {
|
||||
success: false,
|
||||
message: 'Ungueltiger Saison-Slug',
|
||||
data: [],
|
||||
headers: []
|
||||
}
|
||||
}
|
||||
const [spielplan, seasons] = await Promise.all([
|
||||
readSpielplanData({ season: query.season }),
|
||||
listSpielplanSeasons()
|
||||
@@ -28,7 +38,7 @@ export default defineEventHandler(async (event) => {
|
||||
seasons
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Fehler beim Laden des Spielplans:', error)
|
||||
loggerError('Fehler beim Laden des Spielplans:', { error })
|
||||
return {
|
||||
success: false,
|
||||
message: 'Fehler beim Laden des Spielplans',
|
||||
|
||||
Reference in New Issue
Block a user