Refactor team name formatting and update version to 1.8.6
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
import { listSpielplanSeasons, readSpielplanData, validateSeasonSlug } from '../../utils/spielplan-data.js'
|
||||
import { formatTeamDisplayName } from '../../../utils/team-display.js'
|
||||
|
||||
function teamLabel(teamName, teamAgeGroup) {
|
||||
const name = String(teamName || '').trim()
|
||||
const age = String(teamAgeGroup || '').trim()
|
||||
if (!name) return ''
|
||||
const isYouth = age.toLowerCase().includes('jugend') || name.toLowerCase().includes('jugend')
|
||||
return isYouth ? `(J) ${name}` : name
|
||||
return formatTeamDisplayName(teamName, teamAgeGroup)
|
||||
}
|
||||
|
||||
function extractHarheimerTeams(rows) {
|
||||
@@ -58,4 +55,4 @@ export default defineEventHandler(async (event) => {
|
||||
seasons,
|
||||
teams: extractHarheimerTeams(dataResult.data)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user