Skip to content

Commit 81f64e0

Browse files
team_id passed input_task object
1 parent 7b15649 commit 81f64e0

File tree

5 files changed

+21
-16
lines changed

5 files changed

+21
-16
lines changed

src/frontend/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function App() {
88
<Router>
99
<Routes>
1010
<Route path="/" element={<HomePage />} />
11-
<Route path="/plan/:planId/create/:teamId?" element={<PlanCreatePage />} />
11+
<Route path="/plan/:planId/create" element={<PlanCreatePage />} />
1212
<Route path="/plan/:planId" element={<PlanPage />} />
1313
<Route path="*" element={<Navigate to="/" replace />} />
1414
</Routes>

src/frontend/src/components/content/HomeInput.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ const HomeInput: React.FC<HomeInputProps> = ({
6363
let id = showToast("Creating a plan", "progress");
6464

6565
try {
66-
const response = await TaskService.createPlan(input.trim());
66+
const response = await TaskService.createPlan(
67+
input.trim(),
68+
selectedTeam?.team_id
69+
);
6770
setInput("");
6871

6972
if (textareaRef.current) {
@@ -74,12 +77,9 @@ const HomeInput: React.FC<HomeInputProps> = ({
7477
showToast("Plan created!", "success");
7578
dismissToast(id);
7679

77-
// Navigate with team ID if a team is selected
78-
const navPath = selectedTeam
79-
? `/plan/${response.plan_id}/create/${selectedTeam.team_id}`
80-
: `/plan/${response.plan_id}/create`;
81-
console.log('HomeInput: Navigating to:', navPath, 'with team:', selectedTeam?.name);
82-
navigate(navPath);
80+
// Navigate to create page (no team ID in URL anymore)
81+
console.log('HomeInput: Navigating to plan creation with team:', selectedTeam?.name);
82+
navigate(`/plan/${response.plan_id}/create`);
8383
} else {
8484
showToast("Failed to create plan", "error");
8585
dismissToast(id);

src/frontend/src/models/inputTask.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ export interface InputTask {
66
session_id?: string;
77
/** The task description or goal */
88
description: string;
9+
/** Optional team identifier to use for this plan */
10+
team_id?: string;
911
}
1012

1113
/**

src/frontend/src/pages/HomePage.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ const HomePage: React.FC = () => {
131131
const handleNewTask = useCallback(async (taskName: string) => {
132132
if (taskName.trim()) {
133133
try {
134-
const response = await TaskService.createPlan(taskName.trim());
134+
const response = await TaskService.createPlan(
135+
taskName.trim(),
136+
selectedTeam?.team_id
137+
);
135138

136139
if (response.plan_id && response.plan_id !== null) {
137140
dispatchToast(
@@ -145,12 +148,9 @@ const HomePage: React.FC = () => {
145148
{ intent: "success" }
146149
);
147150

148-
// Navigate with team ID if a team is selected
149-
const navPath = selectedTeam
150-
? `/plan/${response.plan_id}/create/${selectedTeam.team_id}`
151-
: `/plan/${response.plan_id}/create`;
152-
console.log('Navigating to:', navPath, 'with team:', selectedTeam?.name);
153-
navigate(navPath);
151+
// Navigate to create page (no team ID in URL anymore)
152+
console.log('Navigating to plan creation with team:', selectedTeam?.name);
153+
navigate(`/plan/${response.plan_id}/create`);
154154
} else {
155155
dispatchToast(
156156
<Toast>

src/frontend/src/services/TaskService.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,16 +200,19 @@ export class TaskService {
200200
/**
201201
* Create a new plan with RAI validation
202202
* @param description Task description
203+
* @param teamId Optional team ID to use for this plan
203204
* @returns Promise with the response containing plan ID and status
204205
*/
205206
static async createPlan(
206-
description: string
207+
description: string,
208+
teamId?: string
207209
): Promise<{ plan_id: string; status: string; session_id: string }> {
208210
const sessionId = this.generateSessionId();
209211

210212
const inputTask: InputTask = {
211213
session_id: sessionId,
212214
description: description,
215+
team_id: teamId,
213216
};
214217

215218
try {

0 commit comments

Comments
 (0)