- Deleted CreateSkillForm and ProfileForm components as they are no longer needed. - Removed the initializeEmptyEvaluation method from EvaluationClient, as the backend handles evaluation creation. - Updated exports in evaluation index to reflect the removal of WelcomeEvaluationScreen.
106 lines
2.3 KiB
TypeScript
106 lines
2.3 KiB
TypeScript
import { BaseHttpClient } from "../base/http-client";
|
|
import { SkillLevel } from "../../lib/types";
|
|
|
|
export class EvaluationClient extends BaseHttpClient {
|
|
/**
|
|
* Met à jour le niveau d'une compétence
|
|
*/
|
|
updateSkillLevel = async (
|
|
category: string,
|
|
skillId: string,
|
|
level: SkillLevel
|
|
): Promise<void> => {
|
|
try {
|
|
await this.put("/evaluations/skills", {
|
|
action: "updateLevel",
|
|
category,
|
|
skillId,
|
|
level,
|
|
});
|
|
} catch (error) {
|
|
console.error("Failed to update skill level:", error);
|
|
throw error;
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Met à jour le statut mentor d'une compétence
|
|
*/
|
|
updateSkillMentorStatus = async (
|
|
category: string,
|
|
skillId: string,
|
|
canMentor: boolean
|
|
): Promise<void> => {
|
|
try {
|
|
await this.put("/evaluations/skills", {
|
|
action: "updateMentorStatus",
|
|
category,
|
|
skillId,
|
|
canMentor,
|
|
});
|
|
} catch (error) {
|
|
console.error("Failed to update skill mentor status:", error);
|
|
throw error;
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Met à jour le statut d'apprentissage d'une compétence
|
|
*/
|
|
updateSkillLearningStatus = async (
|
|
category: string,
|
|
skillId: string,
|
|
wantsToLearn: boolean
|
|
): Promise<void> => {
|
|
try {
|
|
await this.put("/evaluations/skills", {
|
|
action: "updateLearningStatus",
|
|
category,
|
|
skillId,
|
|
wantsToLearn,
|
|
});
|
|
} catch (error) {
|
|
console.error("Failed to update skill learning status:", error);
|
|
throw error;
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Ajoute une compétence à l'évaluation
|
|
*/
|
|
addSkillToEvaluation = async (
|
|
category: string,
|
|
skillId: string
|
|
): Promise<void> => {
|
|
try {
|
|
await this.put("/evaluations/skills", {
|
|
action: "addSkill",
|
|
category,
|
|
skillId,
|
|
});
|
|
} catch (error) {
|
|
console.error("Failed to add skill to evaluation:", error);
|
|
throw error;
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Supprime une compétence de l'évaluation
|
|
*/
|
|
removeSkillFromEvaluation = async (
|
|
category: string,
|
|
skillId: string
|
|
): Promise<void> => {
|
|
try {
|
|
await this.put("/evaluations/skills", {
|
|
action: "removeSkill",
|
|
category,
|
|
skillId,
|
|
});
|
|
} catch (error) {
|
|
console.error("Failed to remove skill from evaluation:", error);
|
|
throw error;
|
|
}
|
|
};
|
|
}
|