Refactor character retrieval in FalukantService for improved clarity

- Changed the character retrieval method to directly access the user's character property instead of querying the database, enhancing code readability and performance.
This commit is contained in:
Torsten Schulz (local)
2026-01-12 11:31:49 +01:00
parent 013c536b47
commit 479f222b54

View File

@@ -2889,7 +2889,7 @@ class FalukantService extends BaseService {
const step1Start = Date.now();
const user = await this.getFalukantUserByHashedId(hashedUserId);
if (!user) throw new Error('User not found');
const character = await FalukantCharacter.findOne({ where: { userId: user.id } });
const character = user.character;
if (!character) throw new Error('Character not found for this user');
timings.step1_user_character = Date.now() - step1Start;