File tree Expand file tree Collapse file tree 3 files changed +6
-18
lines changed
Expand file tree Collapse file tree 3 files changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -87,18 +87,11 @@ export function DashboardContainer({
8787
8888 setUserStatus ( statusData ) ;
8989
90- // console.log("=== Dashboard API Response Debug ===");
91- // console.log("Category:", category);
92- // console.log("Tree Data:", treeData);
93- // console.log("API Nodes count:", treeData?.tree_data?.nodes?.length);
94-
9590 // APIデータをキャンバス用のデータ構造に変換
9691 const canvasNodes = convertApiNodesToCanvasNodes (
9792 treeData . tree_data . nodes ,
9893 category ,
9994 ) ;
100- // console.log("Canvas Nodes count:", canvasNodes.length);
101- // console.log("Canvas Nodes:", canvasNodes);
10295 setSkillTreeNodes ( canvasNodes ) ;
10396 } catch ( err ) {
10497 const errorMessage =
Original file line number Diff line number Diff line change @@ -14,12 +14,7 @@ export function convertApiNodesToCanvasNodes(
1414 apiNodes : ApiSkillNode [ ] ,
1515 category : string = "web" ,
1616) : SkillNode [ ] {
17- // console.log("=== Converter Debug ===");
18- // console.log("Input API Nodes:", apiNodes?.length);
19- // console.log("Category:", category);
20-
2117 if ( ! apiNodes || apiNodes . length === 0 ) {
22- console . warn ( "No API nodes provided!" ) ;
2318 return [ ] ;
2419 }
2520
Original file line number Diff line number Diff line change @@ -48,8 +48,6 @@ export async function fetchSkillTree(category: string): Promise<SkillTreeData> {
4848 // 認証済みユーザーは /users/me エンドポイントを使用(Issue #61, ADR 014)
4949 const url = `${ baseUrl } /api/v1/users/me/skill-trees?category=${ category } ` ;
5050
51- console . log ( `Fetching skill tree: category=${ category } ` ) ;
52-
5351 const response = await fetch ( url , {
5452 credentials : "include" ,
5553 headers : {
@@ -69,15 +67,17 @@ export async function fetchSkillTree(category: string): Promise<SkillTreeData> {
6967
7068 // 空配列が返ってきた場合(初回アクセス)は自動生成
7169 if ( Array . isArray ( data ) && data . length === 0 ) {
72- console . log (
73- `カテゴリ '${ category } ' のスキルツリーが存在しないため、生成します...` ,
74- ) ;
7570 return await generateSkillTree ( category ) ;
7671 }
7772
7873 // 配列の場合は最初の要素を返す(通常は1つのみ)
7974 if ( Array . isArray ( data ) ) {
80- return data [ 0 ] ;
75+ const firstItem = data [ 0 ] ;
76+ // tree_dataが空オブジェクトの場合は自動生成
77+ if ( ! firstItem . tree_data || Object . keys ( firstItem . tree_data ) . length === 0 ) {
78+ return await generateSkillTree ( category ) ;
79+ }
80+ return firstItem ;
8181 }
8282
8383 return data ;
You can’t perform that action at this time.
0 commit comments