Skip to content

Commit c43a2f1

Browse files
authored
fix duplicate rtk call (#1084)
1 parent 6fa850a commit c43a2f1

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

frontend/apps/ui/src/features/documentsList/components/List.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default function DocumentsListByCategory() {
2323
const {isError, data, queryParams, error, isLoading, isFetching} =
2424
useDocumentsListTable()
2525

26-
const visibleColumns = useVisibleColumns()
26+
const visibleColumns = useVisibleColumns(data)
2727
const currentDetailsPanelDocID = useAppSelector(s =>
2828
selectPanelDetailsEntityId(s, "secondary")
2929
)
@@ -77,9 +77,6 @@ export default function DocumentsListByCategory() {
7777
}}
7878
onSortChange={handleSortChange}
7979
loading={isLoading || isFetching}
80-
emptyMessage={t("rolesList.noRolesFound", {
81-
defaultValue: "No roles found"
82-
})}
8380
withCheckbox={true}
8481
onRowClick={onTableRowClick}
8582
getRowId={getRowId}

frontend/apps/ui/src/features/documentsList/hooks/useVisibleColumns.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,21 @@ import flatColumns from "@/features/documentsList/components/flatColumns"
66
import {selectDocumentCategoryID} from "../storage/documentsByCategory"
77
import {DocumentListItem} from "../types"
88

9+
import type {
10+
SearchDocumentsByCategoryResponse,
11+
SearchDocumentsResponse
12+
} from "@/features/documentsList/storage/api"
913
import {selectPanelVisibleColumns} from "@/features/ui/panelRegistry"
1014
import {ColumnConfig} from "kommon"
1115
import {useTranslation} from "react-i18next"
12-
import useDocumentsListTable from "./useDocumentsListTable"
1316

14-
export default function useVisibleColumns(): ColumnConfig<DocumentListItem>[] {
17+
export default function useVisibleColumns(
18+
data?: SearchDocumentsResponse | SearchDocumentsByCategoryResponse
19+
): ColumnConfig<DocumentListItem>[] {
1520
const {t} = useTranslation()
1621
const {panelId} = usePanel()
1722
const categoryID = useAppSelector(selectDocumentCategoryID)
1823
const selected = useAppSelector(s => selectPanelVisibleColumns(s, panelId))
19-
const {data} = useDocumentsListTable()
2024

2125
const hasSelection = selected && selected.length > 0
2226
let columns: ColumnConfig<DocumentListItem>[] = []

frontend/apps/ui/src/features/notifications/components/ClearButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface ClearNotificationsButtonProps {
1010
}
1111

1212
export function ClearNotificationsButton({
13-
threshold = 3
13+
threshold = 1
1414
}: ClearNotificationsButtonProps) {
1515
const {t} = useTranslation()
1616
const count = useAppSelector(selectNotificationCount)

papermerge/core/features/search/db/api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ async def search_documents_by_type(
4747
Returns:
4848
SearchDocumentsByTypeResponse with DocumentCFV items and custom field metadata
4949
"""
50-
5150
if not document_type_id:
5251
raise ValueError("document_type_id is required for this search type")
5352

@@ -238,6 +237,8 @@ async def search_documents_by_type(
238237
page_size=params.page_size,
239238
num_pages=0,
240239
total_items=total_count,
240+
custom_fields=[],
241+
document_type_id=document_type_id
241242
)
242243

243244
# =========================================================================

0 commit comments

Comments
 (0)