Browse Source

fix: on meta populate on existing db generate singular/plural

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5848/head
Pranav C 1 year ago
parent
commit
54b4527650
  1. 13
      packages/nocodb/src/helpers/populateMeta.ts

13
packages/nocodb/src/helpers/populateMeta.ts

@ -126,6 +126,10 @@ export async function extractAndGenerateManyToManyRelations(
belongsToCols[1].colOptions.fk_child_column_id,
type: RelationTypes.MANY_TO_MANY,
uidt: UITypes.Links,
meta: {
plural: pluralize(modelB.title),
singular: singularize(modelB.title),
},
});
}
if (!isRelationAvailInB) {
@ -144,6 +148,10 @@ export async function extractAndGenerateManyToManyRelations(
belongsToCols[0].colOptions.fk_child_column_id,
type: RelationTypes.MANY_TO_MANY,
uidt: UITypes.Links,
meta: {
plural: pluralize(modelA.title),
singular: singularize(modelA.title),
},
});
}
@ -261,6 +269,10 @@ export async function populateMeta(base: Base, project: Project): Promise<any> {
type: 'hm',
hm,
title: `${hm.title} List`,
meta: {
plural: pluralize(hm.title),
singular: singularize(hm.title),
},
};
}),
...belongsTo.map((bt) => {
@ -348,6 +360,7 @@ export async function populateMeta(base: Base, project: Project): Promise<any> {
order: colOrder++,
fk_related_model_id: column.hm ? tnId : rtnId,
system: column.system,
meta: column.meta,
});
// nested relations data apis

Loading…
Cancel
Save