Skip to content

Commit

Permalink
Chore/index crash (#29258)
Browse files Browse the repository at this point in the history
filter items with null colums
  • Loading branch information
saltcod authored and laktek committed Sep 12, 2024
1 parent f42a221 commit 52c265a
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 93,16 @@ const CreateIndexSidePanel = ({ visible, onClose }: CreateIndexSidePanelProps) =
() => entities?.pages.flatMap((page) => page.data.entities) || [],
[entities?.pages]
)

const columns = tableColumns?.result[0]?.columns ?? []
const columnOptions: MultiSelectOption[] = columns.map((column) => {
return { id: column.attname, value: column.attname, name: column.attname, disabled: false }
})
const columnOptions: MultiSelectOption[] = columns
.filter((column): column is NonNullable<typeof column> => column !== null)
.map((column) => ({
id: column.attname,
value: column.attname,
name: column.attname,
disabled: false,
}))

const generatedSQL = `
CREATE INDEX ON "${selectedSchema}"."${selectedEntity}" USING ${selectedIndexType} (${selectedColumns
Expand Down

0 comments on commit 52c265a

Please sign in to comment.