Skip to content

Commit

Permalink
fix manage sync
Browse files Browse the repository at this point in the history
  • Loading branch information
fadingNA committed Nov 10, 2024
1 parent 32c67c2 commit 6974db5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
16 changes: 15 additions & 1 deletion frontend/src/settings/Documents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down Expand Up @@ -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);
});
Expand Down

0 comments on commit 6974db5

Please sign in to comment.