Browse Source

Merge pull request #7505 from nocodb/nc-fix/select-type-fields-issue

Nc fix: select field issue with trailing spaces when creating using API
pull/7532/head
Raju Udava 10 months ago committed by GitHub
parent
commit
47fc9cddbc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 13
      packages/nocodb/src/helpers/getColumnPropsFromUIDT.ts

13
packages/nocodb/src/helpers/getColumnPropsFromUIDT.ts

@ -27,12 +27,13 @@ export default async function getColumnPropsFromUIDT(
newColumn.dtxs = sqlUi.getDefaultScaleForDatatype(newColumn.dt); newColumn.dtxs = sqlUi.getDefaultScaleForDatatype(newColumn.dt);
const selectTypes = [UITypes.MultiSelect, UITypes.SingleSelect]; const selectTypes = [UITypes.MultiSelect, UITypes.SingleSelect];
if ( if (column && selectTypes.includes(column.uidt as UITypes)) {
column && (column as NormalColumnRequestType).dtxp =
selectTypes.includes(newColumn.uidt) && typeof (column as NormalColumnRequestType).dtxp === 'string'
selectTypes.includes(column.uidt as UITypes) ? ((column as NormalColumnRequestType).dtxp as string)
) { .trim()
newColumn.dtxp = (column as NormalColumnRequestType).dtxp; .replace(/'\s*,\s*'/g, "','")
: (column as NormalColumnRequestType).dtxp;
} }
newColumn.altered = column.altered || 2; newColumn.altered = column.altered || 2;

Loading…
Cancel
Save