Skip to content

Commit f011e66

Browse files
committed
fix(tables): align reference config with column registry
1 parent e01efbf commit f011e66

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/column-config-sidebar/column-config-sidebar.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ vi.mock('@/lib/table/column-types', () => ({
7373
{ id: 'select', label: 'Select', icon: () => null },
7474
{ id: 'reference', label: 'Reference', icon: () => null },
7575
],
76-
columnTypeOf: (type: string) => ({ supportsUnique: type !== 'select' }),
76+
columnTypeById: (type: string) => ({ supportsUnique: type !== 'select' }),
7777
}))
7878

7979
vi.mock('@/hooks/queries/tables', () => ({

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/column-config-sidebar/column-config-sidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { X } from '@sim/emcn/icons'
66
import { toError } from '@sim/utils/errors'
77
import { findValidationIssue, isValidationError } from '@/lib/api/client/errors'
88
import type { ColumnDefinition, SelectOption } from '@/lib/table'
9-
import { columnTypeOf } from '@/lib/table/column-types'
9+
import { columnTypeById } from '@/lib/table/column-types'
1010
import {
1111
DEFAULT_CURRENCY_CODE,
1212
getCurrencyOptions,
@@ -143,7 +143,7 @@ function ColumnConfigBody({
143143
const wantsOptions = isSelectType(typeInput)
144144
const wantsCurrency = typeInput === 'currency'
145145
const wantsReference = typeInput === 'reference'
146-
const supportsUnique = columnTypeOf(typeInput).supportsUnique
146+
const supportsUnique = columnTypeById(typeInput).supportsUnique
147147
const { data: workspaceTables = [] } = useTablesList(workspaceId, 'active', {
148148
enabled: wantsReference,
149149
})

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/column-config-sidebar/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export type { ColumnConfig, ColumnConfigurationMetadata } from './column-config-sidebar'
1+
export type { ColumnConfig } from './column-config-sidebar'
22
export { ColumnConfigSidebar } from './column-config-sidebar'
33
export {
44
COLUMN_TYPE_OPTIONS,

0 commit comments

Comments
 (0)