diff --git a/packages/server/src/api/controllers/row/external.js b/packages/server/src/api/controllers/row/external.js index 143aa8a6b2..d259caf721 100644 --- a/packages/server/src/api/controllers/row/external.js +++ b/packages/server/src/api/controllers/row/external.js @@ -1,5 +1,9 @@ const { makeExternalQuery } = require("./utils") -const { DataSourceOperation, SortDirection, FieldTypes } = require("../../../constants") +const { + DataSourceOperation, + SortDirection, + FieldTypes, +} = require("../../../constants") const { getAllExternalTables } = require("../table/utils") const { breakExternalTableId, @@ -81,12 +85,7 @@ async function handleRequest( } await Promise.all(promises) } - const output = outputProcessing( - response, - table, - relationships, - tables - ) + const output = outputProcessing(response, table, relationships, tables) // if reading it'll just be an array of rows, return whole thing return operation === DataSourceOperation.READ && Array.isArray(response) ? output @@ -256,7 +255,11 @@ exports.fetchEnrichedRow = async ctx => { // this seems like a lot of work, but basically we need to dig deeper for the enrich // for a single row, there is probably a better way to do this with some smart multi-layer joins for (let [fieldName, field] of Object.entries(table.schema)) { - if (field.type !== FieldTypes.LINK || !row[fieldName] || row[fieldName].length === 0) { + if ( + field.type !== FieldTypes.LINK || + !row[fieldName] || + row[fieldName].length === 0 + ) { continue } const links = row[fieldName] @@ -275,7 +278,7 @@ exports.fetchEnrichedRow = async ctx => { [linkedTable.primary]: linkedIds, }, }, - }, + } ) } return row diff --git a/packages/server/src/api/controllers/row/externalUtils.js b/packages/server/src/api/controllers/row/externalUtils.js index 85cc11b603..226a8761c8 100644 --- a/packages/server/src/api/controllers/row/externalUtils.js +++ b/packages/server/src/api/controllers/row/externalUtils.js @@ -76,12 +76,7 @@ exports.generateIdForRow = (row, table) => { return generateRowIdField(idParts) } -exports.updateRelationshipColumns = ( - row, - rows, - relationships, - allTables -) => { +exports.updateRelationshipColumns = (row, rows, relationships, allTables) => { const columns = {} for (let relationship of relationships) { const linkedTable = allTables[relationship.tableName] @@ -109,12 +104,7 @@ exports.updateRelationshipColumns = ( return rows } -exports.outputProcessing = ( - rows, - table, - relationships, - allTables -) => { +exports.outputProcessing = (rows, table, relationships, allTables) => { // if no rows this is what is returned? Might be PG only if (rows[0].read === true) { return [] diff --git a/packages/server/src/api/controllers/table/utils.js b/packages/server/src/api/controllers/table/utils.js index 760cc54b3b..78dae60ab1 100644 --- a/packages/server/src/api/controllers/table/utils.js +++ b/packages/server/src/api/controllers/table/utils.js @@ -1,5 +1,3 @@ -import {breakExternalTableId} from "../../../integrations/utils" - const CouchDB = require("../../../db") const csvParser = require("../../../utilities/csvParser") const {