summaryrefslogtreecommitdiff
path: root/lib/tag-numbering
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-04-28 02:13:30 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-04-28 02:13:30 +0000
commitef4c533ebacc2cdc97e518f30e9a9350004fcdfb (patch)
tree345251a3ed0f4429716fa5edaa31024d8f4cb560 /lib/tag-numbering
parent9ceed79cf32c896f8a998399bf1b296506b2cd4a (diff)
~20250428 작업사항
Diffstat (limited to 'lib/tag-numbering')
-rw-r--r--lib/tag-numbering/service.ts4
-rw-r--r--lib/tag-numbering/table/meta-sheet.tsx2
-rw-r--r--lib/tag-numbering/table/tagNumbering-table-toolbar-actions.tsx2
-rw-r--r--lib/tag-numbering/table/tagNumbering-table.tsx10
4 files changed, 14 insertions, 4 deletions
diff --git a/lib/tag-numbering/service.ts b/lib/tag-numbering/service.ts
index 6041f07c..3256b185 100644
--- a/lib/tag-numbering/service.ts
+++ b/lib/tag-numbering/service.ts
@@ -86,13 +86,13 @@ export async function getTagNumbering(input: GetTagNumberigSchema) {
- export const fetchTagSubfieldOptions = (async (attributesId: string): Promise<TagSubfieldOption[]> => {
+ export const fetchTagSubfieldOptions = (async (attributesId: string,projectId:number ): Promise<TagSubfieldOption[]> => {
try {
// (A) findMany -> 스키마 제네릭 누락 에러 발생 → 대신 select().from().where() 사용
const rows = await db
.select()
.from(tagSubfieldOptions)
- .where(eq(tagSubfieldOptions.attributesId, attributesId))
+ .where(and(eq(tagSubfieldOptions.attributesId, attributesId),eq(tagSubfieldOptions.projectId, projectId)))
.orderBy(asc(tagSubfieldOptions.code))
// rows는 TagSubfieldOption[] 형태
diff --git a/lib/tag-numbering/table/meta-sheet.tsx b/lib/tag-numbering/table/meta-sheet.tsx
index 4221837c..fd14e117 100644
--- a/lib/tag-numbering/table/meta-sheet.tsx
+++ b/lib/tag-numbering/table/meta-sheet.tsx
@@ -64,7 +64,7 @@ export function ViewTagOptions({
setLoading(true)
try {
// 서버 액션 호출 - attributesId와 일치하는 모든 옵션 가져오기
- const optionsData = await fetchTagSubfieldOptions(tagSubfield.attributesId)
+ const optionsData = await fetchTagSubfieldOptions(tagSubfield.attributesId, tagSubfield.projectId)
setOptions(optionsData || [])
} catch (error) {
console.error("Error fetching tag options:", error)
diff --git a/lib/tag-numbering/table/tagNumbering-table-toolbar-actions.tsx b/lib/tag-numbering/table/tagNumbering-table-toolbar-actions.tsx
index 7a14817f..9200e81b 100644
--- a/lib/tag-numbering/table/tagNumbering-table-toolbar-actions.tsx
+++ b/lib/tag-numbering/table/tagNumbering-table-toolbar-actions.tsx
@@ -23,7 +23,7 @@ export function TagNumberingTableToolbarActions({ table }: ItemsTableToolbarActi
setIsLoading(true)
// API 엔드포인트 호출
- const response = await fetch('/api/cron/object-classes')
+ const response = await fetch('/api/cron/tag-types')
if (!response.ok) {
const errorData = await response.json()
diff --git a/lib/tag-numbering/table/tagNumbering-table.tsx b/lib/tag-numbering/table/tagNumbering-table.tsx
index 6ca46e05..847b3eeb 100644
--- a/lib/tag-numbering/table/tagNumbering-table.tsx
+++ b/lib/tag-numbering/table/tagNumbering-table.tsx
@@ -132,17 +132,27 @@ export function TagNumberingTable({ promises }: ItemsTableProps) {
shallow: false,
clearOnDefault: true,
})
+ const [isCompact, setIsCompact] = React.useState<boolean>(false)
+
+ const handleCompactChange = React.useCallback((compact: boolean) => {
+ setIsCompact(compact)
+ }, [])
+
return (
<>
<DataTable
table={table}
+ compact={isCompact}
>
<DataTableAdvancedToolbar
table={table}
filterFields={advancedFilterFields}
shallow={false}
+ enableCompactToggle={true}
+ compactStorageKey="tagNumberingTableCompact"
+ onCompactChange={handleCompactChange}
>
<TagNumberingTableToolbarActions table={table} />
</DataTableAdvancedToolbar>