feat(server/client): update function used to display singular documents

This commit is contained in:
perf3ct 2025-06-16 17:10:55 +00:00
parent de4ace5858
commit d51f2793e9
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232
2 changed files with 5 additions and 3 deletions

View File

@ -124,13 +124,13 @@ export const documentService = {
getById: (id: string) => {
// Use the document list endpoint with pagination to find the specific document
// This is a temporary solution until we have a proper document details endpoint
return api.get<Document[]>('/documents', {
return api.get<PaginatedResponse<Document>>('/documents', {
params: {
limit: 1000, // Fetch a reasonable amount to find our document
offset: 0
}
}).then(response => {
const document = response.data.find(doc => doc.id === id);
const document = response.data.documents.find(doc => doc.id === id);
if (!document) {
throw new Error('Document not found');
}

View File

@ -99,13 +99,15 @@ impl SourceSyncService {
info!("WebDAV source sync config: server_url={}, username={}, watch_folders={:?}, file_extensions={:?}, server_type={:?}",
config.server_url, config.username, config.watch_folders, config.file_extensions, config.server_type);
// Requests to list files in a Nextcloud folder might take > 2 minutes
// Set timeout to 3 minutes to accommodate large folder structures
let webdav_config = WebDAVConfig {
server_url: config.server_url,
username: config.username,
password: config.password,
watch_folders: config.watch_folders,
file_extensions: config.file_extensions,
timeout_seconds: 30,
timeout_seconds: 180, // 3 minutes for discover_files_in_folder operations
server_type: config.server_type,
};