Skip to content

Commit f9715fa

Browse files
Merge pull request #434 from microsoft/macae-v3-fr-dev-92
feat: Update plan creation to use plan_id in response
2 parents 8454a1c + f134cbf commit f9715fa

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

src/frontend/src/api/apiService.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ export class APIService {
118118
// return apiClient.post(API_ENDPOINTS.PROCESS_REQUEST, inputTask);
119119
// }
120120

121-
async createPlan(inputTask: InputTask): Promise<{ status: string; session_id: string }> {
122-
return apiClient.post(API_ENDPOINTS.PROCESS_REQUEST, inputTask);
121+
async createPlan(inputTask: InputTask): Promise<InputTaskResponse> {
122+
return apiClient.post(API_ENDPOINTS.PROCESS_REQUEST, inputTask);
123123
}
124124

125125
/**

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ import "../../styles/prism-material-oceanic.css";
1313
import "./../../styles/HomeInput.css";
1414

1515
import { HomeInputProps, iconMap, QuickTask } from "../../models/homeInput";
16-
import { TeamConfig } from "../../models/Team";
1716
import { TaskService } from "../../services/TaskService";
1817
import { NewTaskService } from "../../services/NewTaskService";
1918
import { RAIErrorCard, RAIErrorData } from "../errors";
20-
import { apiService } from "../../api/apiService";
2119

2220
import ChatInput from "@/coral/modules/ChatInput";
2321
import InlineToaster, { useInlineToaster } from "../toast/InlineToaster";
@@ -78,29 +76,24 @@ const HomeInput: React.FC<HomeInputProps> = ({
7876
input.trim(),
7977
selectedTeam?.team_id
8078
);
79+
console.log("Plan created:", response);
8180
setInput("");
8281

8382
if (textareaRef.current) {
8483
textareaRef.current.style.height = "auto";
8584
}
8685

87-
if (response.session_id && response.session_id !== null) {
86+
if (response.plan_id && response.plan_id !== null) {
8887
showToast("Plan created!", "success");
8988
dismissToast(id);
9089

91-
// Navigate to create page (no team ID in URL anymore)
92-
console.log('HomeInput: Navigating to plan creation with team:', selectedTeam?.name);
93-
console.log('HomeInput: Navigating to plan creation with session:', response.session_id);
94-
console.log('HomeInput: Plan created with session:', response.session_id);
95-
96-
navigate(`/plan/${response.session_id}`);
90+
navigate(`/plan/${response.plan_id}`);
9791
} else {
9892
showToast("Failed to create plan", "error");
9993
dismissToast(id);
10094
}
10195
} catch (error: any) {
10296
dismissToast(id);
103-
10497
// Check if this is an RAI validation error
10598
let errorDetail = null;
10699
try {

src/frontend/src/services/TaskService.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export class TaskService {
206206
static async createPlan(
207207
description: string,
208208
teamId?: string
209-
): Promise<{ status: string; session_id: string }> {
209+
): Promise<InputTaskResponse> {
210210
const sessionId = this.generateSessionId();
211211

212212
const inputTask: InputTask = {

0 commit comments

Comments
 (0)