diff --git a/frontend/src/index.css b/frontend/src/index.css index 6de42c24..7c9cc02c 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -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 { diff --git a/frontend/src/settings/Documents.tsx b/frontend/src/settings/Documents.tsx index eaee879e..f91a3355 100644 --- a/frontend/src/settings/Documents.tsx +++ b/frontend/src/settings/Documents.tsx @@ -58,6 +58,7 @@ const Documents: React.FC = ({ ); // 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 = ({ 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); });