Browse Source
Merge pull request #7364 from Budibase/bug/sev2/app-action-no-field-crash
Null safety for App Action no fields
master
melohagan
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
9 additions and
1 deletions
-
packages/builder/src/components/automation/SetupPanel/FieldSelector.svelte
-
packages/server/src/automations/steps/queryRows.js
|
|
|
@ -14,7 +14,7 @@ |
|
|
|
$: { |
|
|
|
let fields = {} |
|
|
|
|
|
|
|
for (const [key, type] of Object.entries(block?.inputs?.fields)) { |
|
|
|
for (const [key, type] of Object.entries(block?.inputs?.fields ?? {})) { |
|
|
|
fields = { |
|
|
|
...fields, |
|
|
|
[key]: { |
|
|
|
|
|
|
|
@ -125,6 +125,14 @@ const hasNullFilters = filters => |
|
|
|
|
|
|
|
exports.run = async function ({ inputs, appId }) { |
|
|
|
const { tableId, filters, sortColumn, sortOrder, limit } = inputs |
|
|
|
if (!tableId) { |
|
|
|
return { |
|
|
|
success: false, |
|
|
|
response: { |
|
|
|
message: "You must select a table to query.", |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
const table = await getTable(appId, tableId) |
|
|
|
let sortType = FieldTypes.STRING |
|
|
|
if (table && table.schema && table.schema[sortColumn] && sortColumn) { |
|
|
|
|