feat(server/client): update function used to display singular documents
This commit is contained in:
parent
2295451204
commit
4aa4359064
|
|
@ -124,13 +124,13 @@ export const documentService = {
|
||||||
getById: (id: string) => {
|
getById: (id: string) => {
|
||||||
// Use the document list endpoint with pagination to find the specific document
|
// 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
|
// 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: {
|
params: {
|
||||||
limit: 1000, // Fetch a reasonable amount to find our document
|
limit: 1000, // Fetch a reasonable amount to find our document
|
||||||
offset: 0
|
offset: 0
|
||||||
}
|
}
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
const document = response.data.find(doc => doc.id === id);
|
const document = response.data.documents.find(doc => doc.id === id);
|
||||||
if (!document) {
|
if (!document) {
|
||||||
throw new Error('Document not found');
|
throw new Error('Document not found');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,13 +99,15 @@ impl SourceSyncService {
|
||||||
info!("WebDAV source sync config: server_url={}, username={}, watch_folders={:?}, file_extensions={:?}, server_type={:?}",
|
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);
|
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 {
|
let webdav_config = WebDAVConfig {
|
||||||
server_url: config.server_url,
|
server_url: config.server_url,
|
||||||
username: config.username,
|
username: config.username,
|
||||||
password: config.password,
|
password: config.password,
|
||||||
watch_folders: config.watch_folders,
|
watch_folders: config.watch_folders,
|
||||||
file_extensions: config.file_extensions,
|
file_extensions: config.file_extensions,
|
||||||
timeout_seconds: 30,
|
timeout_seconds: 180, // 3 minutes for discover_files_in_folder operations
|
||||||
server_type: config.server_type,
|
server_type: config.server_type,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue