refactor: integrate EvaluationClient and remove legacy evaluation actions

- Added EvaluationClient to clients/index.ts and created an instance for use.
- Updated client-wrapper.tsx and welcome-screen.tsx to utilize EvaluationClient for evaluation actions.
- Removed obsolete evaluation-actions.ts file to streamline codebase and reduce redundancy.
This commit is contained in:
Julien Froidefond
2025-08-25 08:06:23 +02:00
parent 1a0877f51d
commit 26496e7473
5 changed files with 135 additions and 178 deletions

View File

@@ -9,13 +9,14 @@ import {
UserProfile,
CategoryEvaluation,
} from "@/lib/types";
import {
updateSkillLevel as updateSkillLevelAction,
updateSkillMentorStatus as updateSkillMentorStatusAction,
updateSkillLearningStatus as updateSkillLearningStatusAction,
addSkillToEvaluation as addSkillToEvaluationAction,
removeSkillFromEvaluation as removeSkillFromEvaluationAction,
} from "@/lib/evaluation-actions";
import { evaluationClient } from "@/clients";
const {
updateSkillLevel: updateSkillLevelAction,
updateSkillMentorStatus: updateSkillMentorStatusAction,
updateSkillLearningStatus: updateSkillLearningStatusAction,
addSkillToEvaluation: addSkillToEvaluationAction,
removeSkillFromEvaluation: removeSkillFromEvaluationAction,
} = evaluationClient;
import { createEmptyEvaluation } from "@/lib/evaluation-utils";
interface EvaluationClientWrapperProps {

View File

@@ -3,7 +3,7 @@
import { useState } from "react";
import { useRouter } from "next/navigation";
import { ProfileForm } from "@/components/profile-form";
import { initializeEmptyEvaluation } from "@/lib/evaluation-actions";
import { evaluationClient } from "@/clients";
import { Team, UserProfile } from "@/lib/types";
import { Code2 } from "lucide-react";
@@ -20,7 +20,7 @@ export function WelcomeEvaluationScreen({
const handleProfileSubmit = async (profile: UserProfile) => {
setIsSubmitting(true);
try {
await initializeEmptyEvaluation(profile);
await evaluationClient.initializeEmptyEvaluation(profile);
// Rafraîchir la page pour que le SSR prenne en compte la nouvelle évaluation
router.refresh();
} catch (error) {