From c56ff5e8dc004df24ab280554c7b449c1c944370 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 31 May 2023 01:33:41 +0530 Subject: [PATCH] chore: add some comments Signed-off-by: Pranav C --- packages/nocodb/src/services/public-metas.service.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/nocodb/src/services/public-metas.service.ts b/packages/nocodb/src/services/public-metas.service.ts index 36f4dcc405..cb4e3664a4 100644 --- a/packages/nocodb/src/services/public-metas.service.ts +++ b/packages/nocodb/src/services/public-metas.service.ts @@ -100,17 +100,22 @@ export class PublicMetasService { colId: lookupColOption.fk_lookup_column_id, }); + // extract meta for table which belongs the relation column + // if not already extracted if (!relatedMetas[relationCol.fk_model_id]) { relatedMetas[relationCol.fk_model_id] = await Model.getWithInfo({ id: lookupCol.fk_model_id, }); } + // extract meta for table in which looked up column belongs + // if not already extracted if (!relatedMetas[lookupCol.fk_model_id]) { relatedMetas[lookupCol.fk_model_id] = await Model.getWithInfo({ id: lookupCol.fk_model_id, }); } + // if looked up column is a lookup column do the same for it by recursion if (lookupCol.uidt === UITypes.Lookup) { await this.extractLookupRelatedMetas({ lookupColOption: await lookupCol.getColOptions(),