Browse Source
Merge pull request #4472 from Budibase/fix/multiple-spaces-in-columns
Replace all spaces with underscores in column names
pull/4505/head
Andrew Kingston
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
2 additions and
2 deletions
-
packages/server/src/api/controllers/row/internalSearch.js
-
packages/server/src/db/views/staticViews.js
|
|
|
@ -235,7 +235,7 @@ class QueryBuilder { |
|
|
|
if (this.sort) { |
|
|
|
const order = this.sortOrder === "descending" ? "-" : "" |
|
|
|
const type = `<${this.sortType}>` |
|
|
|
body.sort = `${order}${this.sort.replace(/ /, "_")}${type}` |
|
|
|
body.sort = `${order}${this.sort.replace(/ /g, "_")}${type}` |
|
|
|
} |
|
|
|
return body |
|
|
|
} |
|
|
|
|
|
|
|
@ -96,7 +96,7 @@ exports.createAllSearchIndex = async () => { |
|
|
|
function idx(input, prev) { |
|
|
|
for (let key of Object.keys(input)) { |
|
|
|
let idxKey = prev != null ? `${prev}.${key}` : key |
|
|
|
idxKey = idxKey.replace(/ /, "_") |
|
|
|
idxKey = idxKey.replace(/ /g, "_") |
|
|
|
if (Array.isArray(input[key])) { |
|
|
|
for (let val of input[key]) { |
|
|
|
if (typeof val !== "object") { |
|
|
|
|