refactor: revew all design of services, clients, deadcode, ...
This commit is contained in:
@@ -15,6 +15,9 @@ export class EvaluationService {
|
||||
async loadUserEvaluationByUuid(
|
||||
userUuid: string
|
||||
): Promise<UserEvaluation | null> {
|
||||
if (!userUuid) {
|
||||
return null;
|
||||
}
|
||||
const pool = getPool();
|
||||
const client = await pool.connect();
|
||||
|
||||
@@ -677,6 +680,23 @@ export class EvaluationService {
|
||||
client.release();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupère l'évaluation complète de l'utilisateur côté serveur
|
||||
* Combine la récupération du cookie et le chargement de l'évaluation
|
||||
*/
|
||||
async getServerUserEvaluation(userUuid: string) {
|
||||
if (!userUuid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
return await this.loadUserEvaluationByUuid(userUuid);
|
||||
} catch (error) {
|
||||
console.error("Failed to get user evaluation:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Instance singleton
|
||||
|
||||
Reference in New Issue
Block a user