Merge pull request #14285 from Budibase/fix/datadog-400-error

Fix for HTTP 400 issue seen in Datadog logs
This commit is contained in:
Michael Drury 2024-07-31 13:30:13 +01:00 committed by GitHub
commit a646fc5052
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 3 deletions

View File

@ -72,10 +72,14 @@ function buildInternalFieldList(
}
if (isRelationship) {
const linkCol = col as RelationshipFieldMetadata
const relatedTable = tables.find(table => table._id === linkCol.tableId)!
const relatedTable = tables.find(table => table._id === linkCol.tableId)
// no relationships provided, don't go more than a layer deep
fieldList = fieldList.concat(buildInternalFieldList(relatedTable, tables))
addJunctionFields(relatedTable, ["doc1.fieldName", "doc2.fieldName"])
if (relatedTable) {
fieldList = fieldList.concat(
buildInternalFieldList(relatedTable, tables)
)
addJunctionFields(relatedTable, ["doc1.fieldName", "doc2.fieldName"])
}
} else {
fieldList.push(`${table._id}.${mapToUserColumn(col.name)}`)
}