Merge branch 'develop' of github.com:Budibase/budibase into merge-master-develop

This commit is contained in:
mike12345567 2022-05-04 14:16:40 +01:00
commit 56f1843f1e
1 changed files with 14 additions and 0 deletions

View File

@ -44,6 +44,20 @@
$: readQuery = query.queryVerb === "read" || query.readable
$: queryInvalid = !query.name || (readQuery && data.length === 0)
//Cast field in query preview response to number if specified by schema
$: {
for (let i = 0; i < data.length; i++) {
let row = data[i]
for (let fieldName of Object.keys(fields)) {
if (fields[fieldName] === "number" && !isNaN(Number(row[fieldName]))) {
row[fieldName] = Number(row[fieldName])
} else {
row[fieldName] = row[fieldName]?.toString()
}
}
}
}
// seed the transformer
if (query && !query.transformer) {
query.transformer = "return data"