1
0
Fork 0
mirror of synced 2024-06-27 02:20:35 +12:00

Handle error when running an automation with a deleted column

This commit is contained in:
Peter Clement 2022-03-21 12:32:04 +00:00
parent daf8284a5b
commit 496e4d5e87

View file

@ -85,7 +85,7 @@ exports.run = async function ({ inputs, appId }) {
const { tableId, filters, sortColumn, sortOrder, limit } = inputs
const table = await getTable(appId, tableId)
let sortType = FieldTypes.STRING
if (table && table.schema && sortColumn) {
if (table && table.schema && table.schema[sortColumn] && sortColumn) {
const fieldType = table.schema[sortColumn].type
sortType =
fieldType === FieldTypes.NUMBER ? FieldTypes.NUMBER : FieldTypes.STRING