Skip to content
Merged
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
10 changes: 6 additions & 4 deletions src/dashboard/react-components/FileAutocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

import React, { useState, useCallback, useEffect, useRef, useMemo } from 'react';
import { getApiUrl } from '../lib/api';

export interface FileAutocompleteProps {
/** Current input value */
Expand Down Expand Up @@ -150,10 +151,11 @@ export function FileAutocomplete({

try {
const searchQuery = query || '';
const response = await fetch(
`${apiBase}/api/files?q=${encodeURIComponent(searchQuery)}&limit=15`,
{ signal: controller.signal }
);
// Use getApiUrl for cloud mode support (routes through workspace proxy)
const url = apiBase
? `${apiBase}/api/files?q=${encodeURIComponent(searchQuery)}&limit=15`
: getApiUrl(`/api/files?q=${encodeURIComponent(searchQuery)}&limit=15`);
const response = await fetch(url, { signal: controller.signal });

if (!response.ok) {
throw new Error('Failed to fetch files');
Expand Down
Loading