Linting.
This commit is contained in:
parent
2d6a8d9ff5
commit
fed82dffaf
|
@ -128,7 +128,7 @@ class InternalBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
private generateSelectStatement(): (string | Knex.Raw)[] | "*" {
|
private generateSelectStatement(): (string | Knex.Raw)[] | "*" {
|
||||||
const { endpoint, resource, meta, tableAliases } = this.query
|
const { endpoint, resource, tableAliases } = this.query
|
||||||
|
|
||||||
if (!resource || !resource.fields || resource.fields.length === 0) {
|
if (!resource || !resource.fields || resource.fields.length === 0) {
|
||||||
return "*"
|
return "*"
|
||||||
|
|
|
@ -7,11 +7,9 @@ import {
|
||||||
ManyToManyRelationshipFieldMetadata,
|
ManyToManyRelationshipFieldMetadata,
|
||||||
RelationshipFieldMetadata,
|
RelationshipFieldMetadata,
|
||||||
RelationshipsJson,
|
RelationshipsJson,
|
||||||
Row,
|
|
||||||
Table,
|
Table,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
import { breakExternalTableId } from "../../../../integrations/utils"
|
import { breakExternalTableId } from "../../../../integrations/utils"
|
||||||
import { basicProcessing } from "./basic"
|
|
||||||
import { generateJunctionTableID } from "../../../../db/utils"
|
import { generateJunctionTableID } from "../../../../db/utils"
|
||||||
|
|
||||||
type TableMap = Record<string, Table>
|
type TableMap = Record<string, Table>
|
||||||
|
@ -22,20 +20,6 @@ export function isManyToMany(
|
||||||
return !!(field as ManyToManyRelationshipFieldMetadata).through
|
return !!(field as ManyToManyRelationshipFieldMetadata).through
|
||||||
}
|
}
|
||||||
|
|
||||||
function isCorrectRelationship(
|
|
||||||
relationship: RelationshipsJson,
|
|
||||||
table1: Table,
|
|
||||||
table2: Table,
|
|
||||||
row: Row
|
|
||||||
): boolean {
|
|
||||||
const junctionTableId = generateJunctionTableID(table1._id!, table2._id!)
|
|
||||||
const possibleColumns = [
|
|
||||||
`${junctionTableId}.doc1.fieldName`,
|
|
||||||
`${junctionTableId}.doc2.fieldName`,
|
|
||||||
]
|
|
||||||
return !!possibleColumns.find(col => row[col] === relationship.column)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the list of relationship JSON structures based on the columns in the table,
|
* Gets the list of relationship JSON structures based on the columns in the table,
|
||||||
* this will be used by the underlying library to build whatever relationship mechanism
|
* this will be used by the underlying library to build whatever relationship mechanism
|
||||||
|
|
Loading…
Reference in New Issue