Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/frontend/src/api/apiService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ export class APIService {
// return apiClient.post(API_ENDPOINTS.PROCESS_REQUEST, inputTask);
// }

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

/**
Expand Down
13 changes: 3 additions & 10 deletions src/frontend/src/components/content/HomeInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ import "../../styles/prism-material-oceanic.css";
import "./../../styles/HomeInput.css";

import { HomeInputProps, iconMap, QuickTask } from "../../models/homeInput";
import { TeamConfig } from "../../models/Team";
import { TaskService } from "../../services/TaskService";
import { NewTaskService } from "../../services/NewTaskService";
import { RAIErrorCard, RAIErrorData } from "../errors";
import { apiService } from "../../api/apiService";

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

if (textareaRef.current) {
textareaRef.current.style.height = "auto";
}

if (response.session_id && response.session_id !== null) {
if (response.plan_id && response.plan_id !== null) {
showToast("Plan created!", "success");
dismissToast(id);

// Navigate to create page (no team ID in URL anymore)
console.log('HomeInput: Navigating to plan creation with team:', selectedTeam?.name);
console.log('HomeInput: Navigating to plan creation with session:', response.session_id);
console.log('HomeInput: Plan created with session:', response.session_id);

navigate(`/plan/${response.session_id}`);
navigate(`/plan/${response.plan_id}`);
} else {
showToast("Failed to create plan", "error");
dismissToast(id);
}
} catch (error: any) {
dismissToast(id);

// Check if this is an RAI validation error
let errorDetail = null;
try {
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/services/TaskService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export class TaskService {
static async createPlan(
description: string,
teamId?: string
): Promise<{ status: string; session_id: string }> {
): Promise<InputTaskResponse> {
const sessionId = this.generateSessionId();

const inputTask: InputTask = {
Expand Down
Loading