refactor: revew all design of services, clients, deadcode, ...
This commit is contained in:
@@ -1,429 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
import {
|
||||
UserEvaluation,
|
||||
SkillCategory,
|
||||
Team,
|
||||
CategoryEvaluation,
|
||||
UserProfile,
|
||||
SkillLevel,
|
||||
} from "@/lib/types";
|
||||
import {
|
||||
loadUserEvaluation,
|
||||
saveUserEvaluation,
|
||||
createEmptyEvaluation,
|
||||
} from "@/lib/evaluation-utils";
|
||||
import { apiClient } from "@/services/api-client";
|
||||
import { loadSkillCategories, loadTeams } from "@/lib/data-loader";
|
||||
import { AuthService } from "@/lib/auth-utils";
|
||||
|
||||
// Fonction pour migrer une évaluation existante avec de nouvelles catégories
|
||||
function migrateEvaluation(
|
||||
evaluation: UserEvaluation,
|
||||
allCategories: SkillCategory[]
|
||||
): UserEvaluation {
|
||||
const existingCategoryNames = evaluation.evaluations.map((e) => e.category);
|
||||
const missingCategories = allCategories.filter(
|
||||
(cat) => !existingCategoryNames.includes(cat.category)
|
||||
);
|
||||
|
||||
if (missingCategories.length === 0) {
|
||||
return evaluation; // Pas de migration nécessaire
|
||||
}
|
||||
|
||||
console.log(
|
||||
"🔄 Migrating evaluation with new categories:",
|
||||
missingCategories.map((c) => c.category)
|
||||
);
|
||||
|
||||
const newCategoryEvaluations: CategoryEvaluation[] = missingCategories.map(
|
||||
(category) => ({
|
||||
category: category.category,
|
||||
skills: [],
|
||||
selectedSkillIds: [],
|
||||
})
|
||||
);
|
||||
|
||||
return {
|
||||
...evaluation,
|
||||
evaluations: [...evaluation.evaluations, ...newCategoryEvaluations],
|
||||
lastUpdated: new Date().toISOString(),
|
||||
};
|
||||
}
|
||||
|
||||
export function useEvaluation() {
|
||||
const [userEvaluation, setUserEvaluation] = useState<UserEvaluation | null>(
|
||||
null
|
||||
);
|
||||
const [skillCategories, setSkillCategories] = useState<SkillCategory[]>([]);
|
||||
const [teams, setTeams] = useState<Team[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
// Load initial data
|
||||
useEffect(() => {
|
||||
async function initializeData() {
|
||||
try {
|
||||
const [categories, teamsData] = await Promise.all([
|
||||
loadSkillCategories(),
|
||||
loadTeams(),
|
||||
]);
|
||||
|
||||
setSkillCategories(categories);
|
||||
setTeams(teamsData);
|
||||
|
||||
// Try to load user profile from cookie and then load evaluation from API
|
||||
try {
|
||||
const profile = await AuthService.getCurrentUser();
|
||||
if (profile) {
|
||||
const saved = await loadUserEvaluation(profile);
|
||||
if (saved) {
|
||||
// Migrate evaluation to include new categories if needed
|
||||
const migratedEvaluation = migrateEvaluation(saved, categories);
|
||||
setUserEvaluation(migratedEvaluation);
|
||||
if (migratedEvaluation !== saved) {
|
||||
await saveUserEvaluation(migratedEvaluation); // Save the migrated version
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (profileError) {
|
||||
console.error("Failed to load user profile:", profileError);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to initialize data:", error);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
initializeData();
|
||||
}, []);
|
||||
|
||||
const loadEvaluationForProfile = async (profile: UserProfile) => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const saved = await loadUserEvaluation(profile);
|
||||
if (saved) {
|
||||
// Migrate evaluation to include new categories if needed
|
||||
const migratedEvaluation = migrateEvaluation(saved, skillCategories);
|
||||
setUserEvaluation(migratedEvaluation);
|
||||
if (migratedEvaluation !== saved) {
|
||||
await saveUserEvaluation(migratedEvaluation); // Save the migrated version
|
||||
}
|
||||
} else {
|
||||
// Create new evaluation
|
||||
const evaluations = createEmptyEvaluation(skillCategories);
|
||||
const newEvaluation: UserEvaluation = {
|
||||
profile,
|
||||
evaluations,
|
||||
lastUpdated: new Date().toISOString(),
|
||||
};
|
||||
setUserEvaluation(newEvaluation);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to load evaluation for profile:", error);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const reloadSkillCategories = async () => {
|
||||
try {
|
||||
const categories = await loadSkillCategories();
|
||||
setSkillCategories(categories);
|
||||
|
||||
// Si on a une évaluation en cours, la migrer avec les nouvelles catégories
|
||||
if (userEvaluation) {
|
||||
const migratedEvaluation = migrateEvaluation(
|
||||
userEvaluation,
|
||||
categories
|
||||
);
|
||||
if (migratedEvaluation !== userEvaluation) {
|
||||
setUserEvaluation(migratedEvaluation);
|
||||
await saveUserEvaluation(migratedEvaluation);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to reload skill categories:", error);
|
||||
}
|
||||
};
|
||||
|
||||
const updateProfile = async (profile: UserProfile) => {
|
||||
const evaluations =
|
||||
userEvaluation?.evaluations || createEmptyEvaluation(skillCategories);
|
||||
const newEvaluation: UserEvaluation = {
|
||||
profile,
|
||||
evaluations,
|
||||
lastUpdated: new Date().toISOString(),
|
||||
};
|
||||
|
||||
// Authenticate user and create cookie
|
||||
await AuthService.login(profile);
|
||||
|
||||
setUserEvaluation(newEvaluation);
|
||||
await saveUserEvaluation(newEvaluation);
|
||||
};
|
||||
|
||||
const updateSkillLevel = async (
|
||||
category: string,
|
||||
skillId: string,
|
||||
level: SkillLevel
|
||||
) => {
|
||||
if (!userEvaluation) return;
|
||||
|
||||
try {
|
||||
// Optimistic update
|
||||
const updatedEvaluations = userEvaluation.evaluations.map((catEval) => {
|
||||
if (catEval.category === category) {
|
||||
const existingSkill = catEval.skills.find(
|
||||
(s) => s.skillId === skillId
|
||||
);
|
||||
const updatedSkills = existingSkill
|
||||
? catEval.skills.map((skill) =>
|
||||
skill.skillId === skillId ? { ...skill, level } : skill
|
||||
)
|
||||
: [...catEval.skills, { skillId, level }];
|
||||
|
||||
return {
|
||||
...catEval,
|
||||
skills: updatedSkills,
|
||||
};
|
||||
}
|
||||
return catEval;
|
||||
});
|
||||
|
||||
const newEvaluation: UserEvaluation = {
|
||||
...userEvaluation,
|
||||
evaluations: updatedEvaluations,
|
||||
lastUpdated: new Date().toISOString(),
|
||||
};
|
||||
|
||||
setUserEvaluation(newEvaluation);
|
||||
|
||||
// Update via API
|
||||
await apiClient.updateSkillLevel(
|
||||
userEvaluation.profile,
|
||||
category,
|
||||
skillId,
|
||||
level
|
||||
);
|
||||
} catch (error) {
|
||||
console.error("Failed to update skill level:", error);
|
||||
// Revert optimistic update if needed
|
||||
}
|
||||
};
|
||||
|
||||
const updateSkillMentorStatus = async (
|
||||
category: string,
|
||||
skillId: string,
|
||||
canMentor: boolean
|
||||
) => {
|
||||
if (!userEvaluation) return;
|
||||
|
||||
try {
|
||||
const updatedEvaluations = userEvaluation.evaluations.map((catEval) => {
|
||||
if (catEval.category === category) {
|
||||
const updatedSkills = catEval.skills.map((skill) =>
|
||||
skill.skillId === skillId ? { ...skill, canMentor } : skill
|
||||
);
|
||||
|
||||
return {
|
||||
...catEval,
|
||||
skills: updatedSkills,
|
||||
};
|
||||
}
|
||||
return catEval;
|
||||
});
|
||||
|
||||
const newEvaluation: UserEvaluation = {
|
||||
...userEvaluation,
|
||||
evaluations: updatedEvaluations,
|
||||
lastUpdated: new Date().toISOString(),
|
||||
};
|
||||
|
||||
setUserEvaluation(newEvaluation);
|
||||
await apiClient.updateSkillMentorStatus(
|
||||
userEvaluation.profile,
|
||||
category,
|
||||
skillId,
|
||||
canMentor
|
||||
);
|
||||
} catch (error) {
|
||||
console.error("Failed to update skill mentor status:", error);
|
||||
}
|
||||
};
|
||||
|
||||
const updateSkillLearningStatus = async (
|
||||
category: string,
|
||||
skillId: string,
|
||||
wantsToLearn: boolean
|
||||
) => {
|
||||
if (!userEvaluation) return;
|
||||
|
||||
try {
|
||||
const updatedEvaluations = userEvaluation.evaluations.map((catEval) => {
|
||||
if (catEval.category === category) {
|
||||
const updatedSkills = catEval.skills.map((skill) =>
|
||||
skill.skillId === skillId ? { ...skill, wantsToLearn } : skill
|
||||
);
|
||||
|
||||
return {
|
||||
...catEval,
|
||||
skills: updatedSkills,
|
||||
};
|
||||
}
|
||||
return catEval;
|
||||
});
|
||||
|
||||
const newEvaluation: UserEvaluation = {
|
||||
...userEvaluation,
|
||||
evaluations: updatedEvaluations,
|
||||
lastUpdated: new Date().toISOString(),
|
||||
};
|
||||
|
||||
setUserEvaluation(newEvaluation);
|
||||
await apiClient.updateSkillLearningStatus(
|
||||
userEvaluation.profile,
|
||||
category,
|
||||
skillId,
|
||||
wantsToLearn
|
||||
);
|
||||
} catch (error) {
|
||||
console.error("Failed to update skill learning status:", error);
|
||||
}
|
||||
};
|
||||
|
||||
const addSkillToEvaluation = async (category: string, skillId: string) => {
|
||||
if (!userEvaluation) return;
|
||||
|
||||
// Sauvegarder l'état actuel pour le rollback
|
||||
const previousEvaluation = userEvaluation;
|
||||
|
||||
try {
|
||||
// Optimistic UI update - mettre à jour immédiatement l'interface
|
||||
const updatedEvaluations = userEvaluation.evaluations.map((catEval) => {
|
||||
if (catEval.category === category) {
|
||||
if (!catEval.selectedSkillIds.includes(skillId)) {
|
||||
return {
|
||||
...catEval,
|
||||
selectedSkillIds: [...catEval.selectedSkillIds, skillId],
|
||||
skills: [
|
||||
...catEval.skills,
|
||||
{ skillId, level: null, canMentor: false, wantsToLearn: false },
|
||||
],
|
||||
};
|
||||
}
|
||||
}
|
||||
return catEval;
|
||||
});
|
||||
|
||||
const newEvaluation: UserEvaluation = {
|
||||
...userEvaluation,
|
||||
evaluations: updatedEvaluations,
|
||||
lastUpdated: new Date().toISOString(),
|
||||
};
|
||||
|
||||
setUserEvaluation(newEvaluation);
|
||||
|
||||
// Appel API en arrière-plan
|
||||
await apiClient.addSkillToEvaluation(
|
||||
userEvaluation.profile,
|
||||
category,
|
||||
skillId
|
||||
);
|
||||
} catch (error) {
|
||||
console.error("Failed to add skill to evaluation:", error);
|
||||
// Rollback optimiste en cas d'erreur
|
||||
setUserEvaluation(previousEvaluation);
|
||||
// Optionnel: afficher une notification d'erreur à l'utilisateur
|
||||
}
|
||||
};
|
||||
|
||||
const removeSkillFromEvaluation = async (
|
||||
category: string,
|
||||
skillId: string
|
||||
) => {
|
||||
if (!userEvaluation) return;
|
||||
|
||||
// Sauvegarder l'état actuel pour le rollback
|
||||
const previousEvaluation = userEvaluation;
|
||||
|
||||
try {
|
||||
// Optimistic UI update - mettre à jour immédiatement l'interface
|
||||
const updatedEvaluations = userEvaluation.evaluations.map((catEval) => {
|
||||
if (catEval.category === category) {
|
||||
return {
|
||||
...catEval,
|
||||
selectedSkillIds: catEval.selectedSkillIds.filter(
|
||||
(id) => id !== skillId
|
||||
),
|
||||
skills: catEval.skills.filter((skill) => skill.skillId !== skillId),
|
||||
};
|
||||
}
|
||||
return catEval;
|
||||
});
|
||||
|
||||
const newEvaluation: UserEvaluation = {
|
||||
...userEvaluation,
|
||||
evaluations: updatedEvaluations,
|
||||
lastUpdated: new Date().toISOString(),
|
||||
};
|
||||
|
||||
setUserEvaluation(newEvaluation);
|
||||
|
||||
// Appel API en arrière-plan
|
||||
await apiClient.removeSkillFromEvaluation(
|
||||
userEvaluation.profile,
|
||||
category,
|
||||
skillId
|
||||
);
|
||||
} catch (error) {
|
||||
console.error("Failed to remove skill from evaluation:", error);
|
||||
// Rollback optimiste en cas d'erreur
|
||||
setUserEvaluation(previousEvaluation);
|
||||
// Optionnel: afficher une notification d'erreur à l'utilisateur
|
||||
}
|
||||
};
|
||||
|
||||
const initializeEmptyEvaluation = async (profile: UserProfile) => {
|
||||
const evaluations = createEmptyEvaluation(skillCategories);
|
||||
const newEvaluation: UserEvaluation = {
|
||||
profile,
|
||||
evaluations,
|
||||
lastUpdated: new Date().toISOString(),
|
||||
};
|
||||
|
||||
// Authenticate user and create cookie
|
||||
await AuthService.login(profile);
|
||||
|
||||
setUserEvaluation(newEvaluation);
|
||||
await saveUserEvaluation(newEvaluation);
|
||||
};
|
||||
|
||||
const clearUserProfile = async () => {
|
||||
try {
|
||||
await AuthService.logout();
|
||||
setUserEvaluation(null);
|
||||
} catch (error) {
|
||||
console.error("Failed to logout:", error);
|
||||
setUserEvaluation(null);
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
userEvaluation,
|
||||
skillCategories,
|
||||
teams,
|
||||
loading,
|
||||
loadEvaluationForProfile,
|
||||
updateProfile,
|
||||
updateSkillLevel,
|
||||
updateSkillMentorStatus,
|
||||
updateSkillLearningStatus,
|
||||
addSkillToEvaluation,
|
||||
removeSkillFromEvaluation,
|
||||
initializeEmptyEvaluation,
|
||||
clearUserProfile,
|
||||
reloadSkillCategories,
|
||||
};
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import { useToast } from "@/hooks/use-toast";
|
||||
import { SkillCategory } from "@/lib/types";
|
||||
import {
|
||||
AdminManagementService,
|
||||
Skill,
|
||||
} from "@/services/admin-management-service";
|
||||
import { adminClient } from "@/clients";
|
||||
import { Skill } from "@/clients/domains/admin-client";
|
||||
|
||||
interface SkillFormData {
|
||||
name: string;
|
||||
@@ -30,7 +28,7 @@ export function useSkillsManagement(skillCategories: SkillCategory[]) {
|
||||
const fetchSkills = async () => {
|
||||
try {
|
||||
setIsLoading(true);
|
||||
const skillsData = await AdminManagementService.getSkills();
|
||||
const skillsData = await adminClient.getSkills();
|
||||
setSkills(skillsData);
|
||||
} catch (error) {
|
||||
console.error("Error fetching skills:", error);
|
||||
@@ -74,7 +72,7 @@ export function useSkillsManagement(skillCategories: SkillCategory[]) {
|
||||
category: category.category,
|
||||
};
|
||||
|
||||
const newSkill = await AdminManagementService.createSkill(skillData);
|
||||
const newSkill = await adminClient.createSkill(skillData);
|
||||
setSkills([...skills, newSkill]);
|
||||
resetForm();
|
||||
|
||||
@@ -130,7 +128,7 @@ export function useSkillsManagement(skillCategories: SkillCategory[]) {
|
||||
usageCount: editingSkill.usageCount,
|
||||
};
|
||||
|
||||
const updatedSkill = await AdminManagementService.updateSkill(skillData);
|
||||
const updatedSkill = await adminClient.updateSkill(skillData);
|
||||
|
||||
const updatedSkills = skills.map((skill) =>
|
||||
skill.id === editingSkill.id ? updatedSkill : skill
|
||||
@@ -167,7 +165,7 @@ export function useSkillsManagement(skillCategories: SkillCategory[]) {
|
||||
}
|
||||
|
||||
try {
|
||||
await AdminManagementService.deleteSkill(skillId);
|
||||
await adminClient.deleteSkill(skillId);
|
||||
setSkills(skills.filter((s) => s.id !== skillId));
|
||||
toast({
|
||||
title: "Succès",
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import { useToast } from "@/hooks/use-toast";
|
||||
import { Team as TeamType } from "@/lib/types";
|
||||
import { TeamStats } from "@/services/admin-service";
|
||||
import {
|
||||
AdminManagementService,
|
||||
Team,
|
||||
} from "@/services/admin-management-service";
|
||||
import { TeamStats } from "@/lib/admin-types";
|
||||
import { adminClient } from "@/clients";
|
||||
|
||||
interface TeamFormData {
|
||||
name: string;
|
||||
@@ -29,7 +26,7 @@ export function useTeamsManagement(
|
||||
// Charger les teams depuis l'API
|
||||
const fetchTeams = async () => {
|
||||
try {
|
||||
const teamsData = await AdminManagementService.getTeams();
|
||||
const teamsData = await adminClient.getTeams();
|
||||
// Note: on garde les teams existantes pour la compatibilité
|
||||
// Les nouvelles teams créées via l'API seront visibles après rafraîchissement
|
||||
} catch (error) {
|
||||
@@ -68,7 +65,7 @@ export function useTeamsManagement(
|
||||
|
||||
try {
|
||||
setIsSubmitting(true);
|
||||
const newTeam = await AdminManagementService.createTeam(teamFormData);
|
||||
const newTeam = await adminClient.createTeam(teamFormData);
|
||||
toast({
|
||||
title: "Succès",
|
||||
description: "Équipe créée avec succès",
|
||||
@@ -129,10 +126,10 @@ export function useTeamsManagement(
|
||||
|
||||
try {
|
||||
setIsSubmitting(true);
|
||||
await AdminManagementService.updateTeam({
|
||||
await adminClient.updateTeam({
|
||||
id: editingTeam.id,
|
||||
...teamFormData,
|
||||
memberCount: editingTeam.memberCount || 0,
|
||||
memberCount: (editingTeam as any).memberCount || 0,
|
||||
});
|
||||
|
||||
toast({
|
||||
@@ -175,7 +172,7 @@ export function useTeamsManagement(
|
||||
)
|
||||
) {
|
||||
try {
|
||||
await AdminManagementService.deleteTeam(teamId);
|
||||
await adminClient.deleteTeam(teamId);
|
||||
toast({
|
||||
title: "Succès",
|
||||
description: "Équipe supprimée avec succès",
|
||||
@@ -183,9 +180,7 @@ export function useTeamsManagement(
|
||||
|
||||
// Mettre à jour l'état local au lieu de recharger la page
|
||||
setTeams((prev) => prev.filter((t) => t.id !== teamId));
|
||||
setTeamStats((prev) =>
|
||||
prev.filter((stats) => stats.teamId !== teamId)
|
||||
);
|
||||
setTeamStats((prev) => prev.filter((stats) => stats.teamId !== teamId));
|
||||
} catch (error: any) {
|
||||
toast({
|
||||
title: "Erreur",
|
||||
@@ -224,17 +219,15 @@ export function useTeamsManagement(
|
||||
)
|
||||
) {
|
||||
try {
|
||||
await AdminManagementService.deleteDirection(direction);
|
||||
await adminClient.deleteDirection(direction);
|
||||
toast({
|
||||
title: "Succès",
|
||||
description: `Direction "${direction}" et toutes ses équipes supprimées avec succès`,
|
||||
variant: "default",
|
||||
});
|
||||
|
||||
|
||||
// Mettre à jour l'état local au lieu de recharger la page
|
||||
setTeams((prev) =>
|
||||
prev.filter((team) => team.direction !== direction)
|
||||
);
|
||||
setTeams((prev) => prev.filter((team) => team.direction !== direction));
|
||||
setTeamStats((prev) =>
|
||||
prev.filter((stats) => stats.direction !== direction)
|
||||
);
|
||||
@@ -250,9 +243,7 @@ export function useTeamsManagement(
|
||||
};
|
||||
|
||||
// Extraire les directions uniques pour les formulaires
|
||||
const directions = Array.from(
|
||||
new Set(teams.map((team) => team.direction))
|
||||
);
|
||||
const directions = Array.from(new Set(teams.map((team) => team.direction)));
|
||||
|
||||
return {
|
||||
teams,
|
||||
|
||||
@@ -16,7 +16,9 @@ export function useTreeView<T>({
|
||||
onSearchChange,
|
||||
}: UseTreeViewOptions<T>) {
|
||||
// État pour les catégories ouvertes/fermées
|
||||
const [expandedCategories, setExpandedCategories] = useState<Set<string>>(new Set());
|
||||
const [expandedCategories, setExpandedCategories] = useState<Set<string>>(
|
||||
new Set()
|
||||
);
|
||||
|
||||
// Grouper les données par catégorie et filtrer en fonction de la recherche
|
||||
const filteredDataByCategory = useMemo(() => {
|
||||
@@ -31,23 +33,26 @@ export function useTreeView<T>({
|
||||
}, {} as Record<string, T[]>);
|
||||
|
||||
// Filtrer les données en fonction de la recherche
|
||||
return Object.entries(dataByCategory).reduce((acc, [category, categoryItems]) => {
|
||||
const filteredItems = categoryItems.filter((item) => {
|
||||
const matchesSearch = searchFields.some((field) => {
|
||||
const value = item[field];
|
||||
if (typeof value === 'string') {
|
||||
return value.toLowerCase().includes(searchTerm.toLowerCase());
|
||||
}
|
||||
return false;
|
||||
return Object.entries(dataByCategory).reduce(
|
||||
(acc, [category, categoryItems]) => {
|
||||
const filteredItems = categoryItems.filter((item) => {
|
||||
const matchesSearch = searchFields.some((field) => {
|
||||
const value = item[field];
|
||||
if (typeof value === "string") {
|
||||
return value.toLowerCase().includes(searchTerm.toLowerCase());
|
||||
}
|
||||
return false;
|
||||
});
|
||||
return matchesSearch;
|
||||
});
|
||||
return matchesSearch;
|
||||
});
|
||||
|
||||
if (filteredItems.length > 0) {
|
||||
acc[category] = filteredItems;
|
||||
}
|
||||
return acc;
|
||||
}, {} as Record<string, T[]>);
|
||||
if (filteredItems.length > 0) {
|
||||
acc[category] = filteredItems;
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{} as Record<string, T[]>
|
||||
);
|
||||
}, [data, searchFields, groupBy, searchTerm]);
|
||||
|
||||
// Fonctions pour gérer l'expansion des catégories
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import { useToast } from "@/hooks/use-toast";
|
||||
import { Team } from "@/services/admin-management-service";
|
||||
import { Team } from "@/clients/domains/admin-client";
|
||||
|
||||
interface User {
|
||||
uuid: string;
|
||||
@@ -113,7 +113,7 @@ export function useUsersManagement(teams: Team[]) {
|
||||
setDeletingUserId(user.uuid);
|
||||
try {
|
||||
// TODO: Implémenter la suppression d'utilisateur
|
||||
// await AdminManagementService.deleteUser(user.uuid);
|
||||
// await adminClient.deleteUser(user.uuid);
|
||||
|
||||
// Mettre à jour la liste locale
|
||||
setUsers((prev) => prev.filter((u) => u.uuid !== user.uuid));
|
||||
|
||||
Reference in New Issue
Block a user