fix: add 404 response to OpenAPI spec, fix TypeScript type for optional title

This commit is contained in:
Otto
2026-02-14 13:14:51 +00:00
parent bc9f4abd32
commit 4beec4cf24
2 changed files with 3 additions and 2 deletions

View File

@@ -216,6 +216,7 @@ async def create_session(
"/sessions/{session_id}",
dependencies=[Security(auth.requires_user)],
status_code=204,
responses={404: {"description": "Session not found or access denied"}},
)
async def delete_session(
session_id: str,

View File

@@ -31,7 +31,7 @@ export function ChatSidebar() {
const [sessionId, setSessionId] = useQueryState("sessionId", parseAsString);
const [sessionToDelete, setSessionToDelete] = useState<{
id: string;
title: string | null;
title: string | null | undefined;
} | null>(null);
const queryClient = useQueryClient();
@@ -79,7 +79,7 @@ export function ChatSidebar() {
function handleDeleteClick(
e: React.MouseEvent,
id: string,
title: string | null,
title: string | null | undefined,
) {
e.stopPropagation(); // Prevent session selection
if (isDeleting) return; // Prevent double-click during deletion