Homebrew manager completed !

This commit is contained in:
Clément Pons
2025-08-26 15:27:47 +02:00
parent 80a94bee86
commit da93fcd82d
14 changed files with 1173 additions and 244 deletions

View File

@@ -58,6 +58,7 @@ export default defineEventHandler(async (e) => {
modifiers: true,
spells: true,
training: true,
choices: true,
user: {
columns: { username: true }
}
@@ -80,9 +81,10 @@ export default defineEventHandler(async (e) => {
training: character.training.reduce((p, v) => { if(!(v.stat in p)) p[v.stat] = []; p[v.stat].push([v.level as TrainingLevel, v.choice]); return p; }, {} as Record<MainStat, DoubleIndex<TrainingLevel>[]>),
leveling: character.levels.map(e => [e.level as Level, e.choice] as DoubleIndex<Level>),
abilities: group(character.abilities.map(e => ({ ...e, value: [e.value, e.max] as [number, number] })), "ability", "value"),
abilities: group(character.abilities, "ability", "value"),
spells: character.spells.map(e => e.value),
modifiers: group(character.modifiers, "modifier", "value"),
choices: character.choices.reduce((p, v) => { p[v.id] ??= []; p[v.id]?.push(v.choice); return p; }, {} as Record<string, number[]>),
owner: character.owner,
username: character.user.username,