Browse Source

fix: handle scenarios where no select options are there

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/7287/head
Pranav C 11 months ago
parent
commit
a9d21daa6b
  1. 10
      packages/nocodb/src/db/BaseModelSqlv2.ts

10
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -3846,9 +3846,6 @@ class BaseModelSqlv2 {
return; return;
} }
const options = await column
.getColOptions<{ options: SelectOption[] }>()
.then(({ options }) => options.map((opt) => opt.title));
const columnTitle = column.title; const columnTitle = column.title;
const columnName = column.column_name; const columnName = column.column_name;
const columnValue = const columnValue =
@ -3857,6 +3854,13 @@ class BaseModelSqlv2 {
return; return;
} }
const options = await column
.getColOptions<{ options: SelectOption[] }>()
.then(
(selectOptionsMeta) =>
selectOptionsMeta?.options?.map((opt) => opt.title) || [],
);
// if multi select, then split the values // if multi select, then split the values
const columnValueArr = const columnValueArr =
column.uidt === UITypes.MultiSelect column.uidt === UITypes.MultiSelect

Loading…
Cancel
Save