Browse Source

fix: update delete payload

pull/6982/head
Pranav C 12 months 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,
});
// 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;
}

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

@ -148,12 +148,12 @@ export const getModelPaths = async (ctx: {
schema: {
oneOf: [
{
$ref: `#/components/schemas/${ctx.tableName}Request`,
$ref: `#/components/schemas/${ctx.tableName}IdRequest`,
},
{
type: 'array',
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: {
tableName: string;

Loading…
Cancel
Save