refactor: update data fetching in management pages and improve type imports
- Simplified data extraction from AdminService in SkillsPage, TeamsPage, and UsersPage. - Updated import paths for Team type in user-related components for consistency. - Added id and name properties to SkillCategory interface for better data structure. - Enhanced logging in useSkillsManagement for debugging skill creation process.
This commit is contained in:
@@ -53,6 +53,7 @@ export function useSkillsManagement(skillCategories: SkillCategory[]) {
|
||||
};
|
||||
|
||||
const handleCreateSkill = async () => {
|
||||
console.log("skillFormData", skillFormData);
|
||||
if (!skillFormData.name || !skillFormData.categoryId) {
|
||||
toast({
|
||||
title: "Erreur",
|
||||
@@ -70,6 +71,7 @@ export function useSkillsManagement(skillCategories: SkillCategory[]) {
|
||||
const skillData = {
|
||||
...skillFormData,
|
||||
category: category.category,
|
||||
categoryId: category.id,
|
||||
};
|
||||
|
||||
const newSkill = await adminClient.createSkill(skillData);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import { useToast } from "@/hooks/use-toast";
|
||||
import { Team } from "@/clients/domains/admin-client";
|
||||
import { Team } from "@/lib/types";
|
||||
|
||||
interface User {
|
||||
uuid: string;
|
||||
|
||||
Reference in New Issue
Block a user