Browse Source

Merge pull request #6956 from nocodb/fix/trim-title

fix: trim leading and trailing spaces from column titles
pull/6962/head
mertmit 1 year ago committed by GitHub
parent
commit
b9be46e123
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      packages/nocodb/src/services/columns.service.ts

10
packages/nocodb/src/services/columns.service.ts

@ -124,6 +124,11 @@ export class ColumnsService {
param.column.column_name = sanitizeColumnName(param.column.column_name);
}
// trim leading and trailing spaces from column title as knex trim them by default
if (param.column.title) {
param.column.title = param.column.title.trim();
}
if (param.column.column_name) {
// - 5 is a buffer for suffix
let colName = param.column.column_name.slice(0, mxColumnLength - 5);
@ -1068,6 +1073,11 @@ export class ColumnsService {
param.column.column_name = sanitizeColumnName(param.column.column_name);
}
// trim leading and trailing spaces from column title as knex trim them by default
if (param.column.title) {
param.column.title = param.column.title.trim();
}
if (param.column.column_name) {
// - 5 is a buffer for suffix
let colName = param.column.column_name.slice(0, mxColumnLength - 5);

Loading…
Cancel
Save