mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
fix manage sync
This commit is contained in:
@@ -54,7 +54,7 @@ body.dark {
|
||||
}
|
||||
|
||||
.table-default th {
|
||||
@apply p-4 w-1/3 font-normal text-gray-400 text-nowrap; /* Remove border-r */
|
||||
@apply p-4 w-full font-normal text-gray-400 text-nowrap; /* Remove border-r */
|
||||
}
|
||||
|
||||
.table-default th:last-child {
|
||||
|
||||
@@ -58,6 +58,7 @@ const Documents: React.FC<DocumentsProps> = ({
|
||||
);
|
||||
// State for documents
|
||||
const currentDocuments = filteredDocuments ?? [];
|
||||
console.log('currentDocuments', currentDocuments);
|
||||
const syncOptions = [
|
||||
{ label: 'Never', value: 'never' },
|
||||
{ label: 'Daily', value: 'daily' },
|
||||
@@ -101,12 +102,25 @@ const Documents: React.FC<DocumentsProps> = ({
|
||||
userService
|
||||
.manageSync({ source_id: doc.id, sync_frequency })
|
||||
.then(() => {
|
||||
// First, fetch the updated source docs
|
||||
return getDocs();
|
||||
})
|
||||
.then((data) => {
|
||||
dispatch(setSourceDocs(data));
|
||||
return getDocsWithPagination(
|
||||
sortField,
|
||||
sortOrder,
|
||||
currentPage,
|
||||
rowsPerPage,
|
||||
);
|
||||
})
|
||||
.catch((error) => console.error(error))
|
||||
.then((paginatedData) => {
|
||||
dispatch(
|
||||
setPaginatedDocuments(paginatedData ? paginatedData.docs : []),
|
||||
);
|
||||
setTotalPages(paginatedData ? paginatedData.totalPages : 0);
|
||||
})
|
||||
.catch((error) => console.error('Error in handleManageSync:', error))
|
||||
.finally(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user