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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user