Add character notes and more debugging for mailserver (help me !!!)

This commit is contained in:
Clément Pons
2025-04-22 17:40:39 +02:00
parent 32439b41f6
commit a30f394ef7
8 changed files with 26 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
import { and, eq } from 'drizzle-orm';
import useDatabase from '~/composables/useDatabase';
import { characterTable } from '~/db/schema';
import type { Character, CharacterConfig, CompiledCharacter, DoubleIndex, Feature, MainStat, TrainingLevel, TrainingOption } from '~/types/character';
import type { Ability, Character, CharacterConfig, CompiledCharacter, DoubleIndex, Feature, MainStat, TrainingLevel, TrainingOption } from '~/types/character';
import characterData from '#shared/character-config.json';
import { users } from '~/drizzle/schema';
@@ -191,13 +191,14 @@ function compileCharacter(character: Character & { username?: string }): Compile
},
initiative: 0,
aspect: "",
notes: character.progress.notes,
};
features.forEach(e => e[1].forEach((_e, i) => applyTrainingOption(e[0], _e, compiled, i === e[1].length - 1)));
specialFeatures(compiled, character.progress.training);
Object.entries(character.progress.abilities).forEach(e => compiled.abilities[e[0]] += e[1][0]);
Object.entries(character.progress.abilities).forEach(e => compiled.abilities[e[0] as Ability]! += e[1][0]);
return compiled;
}
function applyTrainingOption(stat: MainStat, option: TrainingOption, character: CompiledCharacter, last: boolean)

View File

@@ -23,6 +23,8 @@ interface MailPayload
data: Record<string, any>
}
console.log(config);
const transport = nodemailer.createTransport({
//@ts-ignore
pool: true,