Browse Source

Merge pull request #1901 from nocodb/fix/1899-swagger-json

fix: pass correct project id to get model list
pull/1909/head
աɨռɢӄաօռɢ 3 years ago committed by GitHub
parent
commit
9dbf1b40ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSwaggerColumnMetas.ts
  2. 2
      packages/nocodb/src/lib/noco/meta/api/swagger/swaggerApis.ts

8
packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSwaggerColumnMetas.ts

@ -26,9 +26,11 @@ export default async (
const colOpt = await c.getColOptions<LinkToAnotherRecordColumn>(
ncMeta
);
const relTable = await colOpt.getRelatedTable(ncMeta);
field.type = undefined;
field.$ref = `#/components/schemas/${relTable.title}Request`;
if (colOpt) {
const relTable = await colOpt.getRelatedTable(ncMeta);
field.type = undefined;
field.$ref = `#/components/schemas/${relTable.title}Request`;
}
}
break;
case UITypes.Formula:

2
packages/nocodb/src/lib/noco/meta/api/swagger/swaggerApis.ts

@ -13,7 +13,7 @@ async function swaggerJson(req, res) {
if (!project) NcError.notFound();
const models = await Model.list({
project_id: req.params.project_id,
project_id: req.params.projectId,
base_id: null
});

Loading…
Cancel
Save