Browse Source
Merge pull request #2259 from Budibase/fix/sql-2250
SQL varchar/number parsing fix
gh-pages
Michael Drury
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
4 additions and
2 deletions
-
packages/server/src/api/controllers/row/ExternalRequest.ts
-
packages/server/src/integrations/base/sql.ts
|
|
|
@ -165,6 +165,10 @@ module External { |
|
|
|
if (!row[key] || newRow[key] || field.autocolumn) { |
|
|
|
continue |
|
|
|
} |
|
|
|
// parse floats/numbers
|
|
|
|
if (field.type === FieldTypes.NUMBER && !isNaN(parseFloat(row[key]))) { |
|
|
|
newRow[key] = parseFloat(row[key]) |
|
|
|
} |
|
|
|
// if its not a link then just copy it over
|
|
|
|
if (field.type !== FieldTypes.LINK) { |
|
|
|
newRow[key] = row[key] |
|
|
|
|
|
|
|
@ -19,8 +19,6 @@ function parseBody(body: any) { |
|
|
|
} |
|
|
|
if (isIsoDateString(value)) { |
|
|
|
body[key] = new Date(value) |
|
|
|
} else if (!isNaN(parseFloat(value))) { |
|
|
|
body[key] = parseFloat(value) |
|
|
|
} |
|
|
|
} |
|
|
|
return body |
|
|
|
|