diff options
| author | 0-Zz-ang <s1998319@gmail.com> | 2025-07-29 09:08:52 +0900 |
|---|---|---|
| committer | 0-Zz-ang <s1998319@gmail.com> | 2025-07-29 09:11:22 +0900 |
| commit | 8d92c88ab341156d82156bae49c62a8101280e75 (patch) | |
| tree | 065ed1838de4164da23e3777b5367143e4f13982 /lib/docu-list-rule/combo-box-settings/table | |
| parent | 75249e6fa46864f49d4eb91bd755171b6b65eaae (diff) | |
(박서영) 설계 Document Numbering Rule 수정
Diffstat (limited to 'lib/docu-list-rule/combo-box-settings/table')
| -rw-r--r-- | lib/docu-list-rule/combo-box-settings/table/combo-box-options-detail-sheet.tsx | 8 | ||||
| -rw-r--r-- | lib/docu-list-rule/combo-box-settings/table/combo-box-settings-table.tsx | 7 |
2 files changed, 9 insertions, 6 deletions
diff --git a/lib/docu-list-rule/combo-box-settings/table/combo-box-options-detail-sheet.tsx b/lib/docu-list-rule/combo-box-settings/table/combo-box-options-detail-sheet.tsx index 1c145c55..0b2a76a4 100644 --- a/lib/docu-list-rule/combo-box-settings/table/combo-box-options-detail-sheet.tsx +++ b/lib/docu-list-rule/combo-box-settings/table/combo-box-options-detail-sheet.tsx @@ -88,13 +88,12 @@ export function ComboBoxOptionsDetailSheet({ const result = await getComboBoxOptions(codeGroup.id, { page: 1, perPage: 10, - search: "", - sort: [{ id: "createdAt", desc: true }], - filters: [], + search: table.getState().globalFilter || "", + sort: table.getState().sorting, + filters: table.getState().columnFilters, joinOperator: "and", }) if (result.success && result.data) { - // isActive 필드가 없는 경우 기본값 true로 설정 const optionsWithIsActive = result.data.map(option => ({ ...option, isActive: (option as any).isActive ?? true @@ -126,6 +125,7 @@ export function ComboBoxOptionsDetailSheet({ enableAdvancedFilter: true, manualSorting: true, manualFiltering: true, + manualPagination: true, // 수동 페이징 활성화 initialState: { sorting: [{ id: "createdAt", desc: true }], columnPinning: { right: ["actions"] }, diff --git a/lib/docu-list-rule/combo-box-settings/table/combo-box-settings-table.tsx b/lib/docu-list-rule/combo-box-settings/table/combo-box-settings-table.tsx index 356b2706..f6216363 100644 --- a/lib/docu-list-rule/combo-box-settings/table/combo-box-settings-table.tsx +++ b/lib/docu-list-rule/combo-box-settings/table/combo-box-settings-table.tsx @@ -1,6 +1,7 @@ "use client" import * as React from "react" +import { useRouter } from "next/navigation" import { useDataTable } from "@/hooks/use-data-table" import { DataTable } from "@/components/data-table/data-table" import { DataTableAdvancedToolbar } from "@/components/data-table/data-table-advanced-toolbar" @@ -16,13 +17,15 @@ interface ComboBoxSettingsTableProps { } export function ComboBoxSettingsTable({ promises }: ComboBoxSettingsTableProps) { + const router = useRouter() const rawData = React.use(promises!) const [isDetailSheetOpen, setIsDetailSheetOpen] = React.useState(false) const [selectedCodeGroup, setSelectedCodeGroup] = React.useState<typeof codeGroups.$inferSelect | null>(null) const refreshData = React.useCallback(() => { - window.location.reload() - }, []) + // 전체 페이지 새로고침 대신 router.refresh() 사용 (성능 개선) + router.refresh() + }, [router]) // Detail 버튼 클릭 핸들러 const handleDetail = (codeGroup: typeof codeGroups.$inferSelect) => { |
