Prevent repeated fields on select
This commit is contained in:
parent
d60cc7aaf4
commit
0ef4a154ef
|
@ -158,12 +158,6 @@ export async function buildSqlFieldList(
|
|||
|
||||
const isView = sdk.views.isView(source)
|
||||
|
||||
if (isView) {
|
||||
fields = Object.keys(helpers.views.basicFields(source))
|
||||
} else {
|
||||
fields = extractRealFields(source)
|
||||
}
|
||||
|
||||
let table: Table
|
||||
if (isView) {
|
||||
table = await sdk.views.getTable(source.id)
|
||||
|
@ -172,6 +166,14 @@ export async function buildSqlFieldList(
|
|||
table = source
|
||||
}
|
||||
|
||||
if (isView) {
|
||||
fields = Object.keys(helpers.views.basicFields(source)).map(
|
||||
c => `${table.name}.${c}`
|
||||
)
|
||||
} else {
|
||||
fields = extractRealFields(source)
|
||||
}
|
||||
|
||||
fields.push(
|
||||
...getRequiredFields(
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue