@@ -21,7 +21,6 @@ import { TaskService } from '../services/TaskService';
2121import { TeamConfig } from '../models/Team' ;
2222import { TeamService } from '../services/TeamService' ;
2323import InlineToaster , { useInlineToaster } from "../components/toast/InlineToaster" ;
24- import { initializeTeam } from '@/api/config' ;
2524
2625/**
2726 * HomePage component - displays task lists and provides navigation
@@ -83,14 +82,14 @@ useEffect(() => {
8382 console . log ( 'Initializing team from backend...' ) ;
8483
8584 // Call the backend init_team endpoint (takes ~20 seconds)
86- const initResponse = await initializeTeam ( ) ;
85+ const initResponse = await TeamService . initializeTeam ( ) ;
8786
88- if ( initResponse . status === 'Request started successfully' && initResponse . team_id ) {
89- console . log ( 'Team initialization completed:' , initResponse . team_id ) ;
87+ if ( initResponse . data ?. status === 'Request started successfully' && initResponse . data ? .team_id ) {
88+ console . log ( 'Team initialization completed:' , initResponse . data ?. team_id ) ;
9089
9190 // Now fetch the actual team details using the team_id
9291 const teams = await TeamService . getUserTeams ( ) ;
93- const initializedTeam = teams . find ( team => team . team_id === initResponse . team_id ) ;
92+ const initializedTeam = teams . find ( team => team . team_id === initResponse . data ?. team_id ) ;
9493
9594 if ( initializedTeam ) {
9695 setSelectedTeam ( initializedTeam ) ;
@@ -158,7 +157,7 @@ useEffect(() => {
158157 } ;
159158
160159 initTeam ( ) ;
161- } , [ showToast ] ) ;
160+ } , [ ] ) ;
162161
163162 /**
164163 * Handle new task creation from the "New task" button
0 commit comments