Browse Source

fix: update delete payload

pull/6982/head
Pranav C 1 year ago
parent
commit
80a916d6ba
  1. 17
      packages/nocodb/src/services/api-docs/swaggerV2/getPaths.ts
  2. 4
      packages/nocodb/src/services/api-docs/swaggerV2/templates/paths.ts
  3. 19
      packages/nocodb/src/services/api-docs/swaggerV2/templates/schemas.ts

17
packages/nocodb/src/services/api-docs/swaggerV2/getPaths.ts

@ -24,22 +24,5 @@ export default async function getPaths(
columns, columns,
}); });
// for (const { view, columns: viewColumns } of views) {
// const swaggerColumns = columns.filter(
// (c) => viewColumns.find((vc) => vc.fk_column_id === c.column.id)?.show,
// );
// Object.assign(
// swaggerPaths,
// await getViewPaths({
// tableName: model.title,
// viewName: view.title,
// type: model.type,
// orgs: 'v1',
// columns: swaggerColumns,
// baseName: base.id,
// }),
// );
// }
return swaggerPaths; return swaggerPaths;
} }

4
packages/nocodb/src/services/api-docs/swaggerV2/templates/paths.ts

@ -148,12 +148,12 @@ export const getModelPaths = async (ctx: {
schema: { schema: {
oneOf: [ oneOf: [
{ {
$ref: `#/components/schemas/${ctx.tableName}Request`, $ref: `#/components/schemas/${ctx.tableName}IdRequest`,
}, },
{ {
type: 'array', type: 'array',
items: { items: {
$ref: `#/components/schemas/${ctx.tableName}Request`, $ref: `#/components/schemas/${ctx.tableName}IdRequest`,
}, },
}, },
], ],

19
packages/nocodb/src/services/api-docs/swaggerV2/templates/schemas.ts

@ -40,6 +40,25 @@ export const getModelSchemas = (ctx: {
) || {}), ) || {}),
}, },
}, },
[`${ctx.tableName}IdRequest`]: {
title: `${ctx.tableName} Id Request`,
type: 'object',
description: '',
'x-internal': false,
properties: {
...(ctx.columns?.reduce(
(colsObj, { title, virtual, column, ...fieldProps }) => ({
...colsObj,
...(column.pk
? {
[title]: fieldProps,
}
: {}),
}),
{},
) || {}),
},
},
}); });
export const getViewSchemas = (ctx: { export const getViewSchemas = (ctx: {
tableName: string; tableName: string;

Loading…
Cancel
Save