Browse Source

fix: handle qrcode and barcode lookup

pull/6987/head
Pranav C 1 year ago
parent
commit
a2b01bb822
  1. 9
      packages/nocodb/src/db/generateLookupSelectQuery.ts

9
packages/nocodb/src/db/generateLookupSelectQuery.ts

@ -9,6 +9,7 @@ import type {
RollupColumn, RollupColumn,
} from '~/models'; } from '~/models';
import type { LinksColumn } from '~/models'; import type { LinksColumn } from '~/models';
import type { BarcodeColumn, QrCodeColumn } from '~/models';
import formulaQueryBuilderv2 from '~/db/formulav2/formulaQueryBuilderv2'; import formulaQueryBuilderv2 from '~/db/formulav2/formulaQueryBuilderv2';
import genRollupSelectv2 from '~/db/genRollupSelectv2'; import genRollupSelectv2 from '~/db/genRollupSelectv2';
import { getAliasGenerator } from '~/utils'; import { getAliasGenerator } from '~/utils';
@ -143,6 +144,14 @@ export default async function generateLookupSelectQuery({
let lookupColumn = lookupColOpt let lookupColumn = lookupColOpt
? await lookupColOpt.getLookupColumn() ? await lookupColOpt.getLookupColumn()
: await getDisplayValueOfRefTable(column); : await getDisplayValueOfRefTable(column);
// if lookup column is qr code or barcode extract the referencing column
if ([UITypes.QrCode, UITypes.Barcode].includes(lookupColumn.uidt)) {
lookupColumn = await lookupColumn
.getColOptions<BarcodeColumn | QrCodeColumn>()
.then((barcode) => barcode.getValueColumn());
}
let prevAlias = alias; let prevAlias = alias;
while ( while (
lookupColumn.uidt === UITypes.Lookup || lookupColumn.uidt === UITypes.Lookup ||

Loading…
Cancel
Save