Browse Source

chore: lint

pull/6644/head
Pranav C 1 year ago
parent
commit
77343f3c74
  1. 20
      packages/nocodb/src/controllers/bulk-data-alias.controller.ts
  2. 8
      packages/nocodb/src/controllers/data-alias-nested.controller.ts
  3. 2
      packages/nocodb/src/models/Base.ts
  4. 35
      packages/nocodb/src/services/api-docs/swagger/templates/paths.ts

20
packages/nocodb/src/controllers/bulk-data-alias.controller.ts

@ -20,9 +20,7 @@ import { DataApiLimiterGuard } from '~/guards/data-api-limiter.guard';
export class BulkDataAliasController {
constructor(private bulkDataAliasService: BulkDataAliasService) {}
@Post([
'/api/v1/db/data/bulk/:orgs/:baseName/:tableName',
])
@Post(['/api/v1/db/data/bulk/:orgs/:baseName/:tableName'])
@HttpCode(200)
@Acl('bulkDataInsert')
async bulkDataInsert(
@ -42,9 +40,7 @@ export class BulkDataAliasController {
res.json(exists);
}
@Patch([
'/api/v1/db/data/bulk/:orgs/:baseName/:tableName',
])
@Patch(['/api/v1/db/data/bulk/:orgs/:baseName/:tableName'])
@Acl('bulkDataUpdate')
async bulkDataUpdate(
@Request() req,
@ -61,9 +57,7 @@ export class BulkDataAliasController {
}
// todo: Integrate with filterArrJson bulkDataUpdateAll
@Patch([
'/api/v1/db/data/bulk/:orgs/:baseName/:tableName/all',
])
@Patch(['/api/v1/db/data/bulk/:orgs/:baseName/:tableName/all'])
@Acl('bulkDataUpdateAll')
async bulkDataUpdateAll(
@Request() req,
@ -80,9 +74,7 @@ export class BulkDataAliasController {
});
}
@Delete([
'/api/v1/db/data/bulk/:orgs/:baseName/:tableName',
])
@Delete(['/api/v1/db/data/bulk/:orgs/:baseName/:tableName'])
@Acl('bulkDataDelete')
async bulkDataDelete(
@Request() req,
@ -100,9 +92,7 @@ export class BulkDataAliasController {
// todo: Integrate with filterArrJson bulkDataDeleteAll
@Delete([
'/api/v1/db/data/bulk/:orgs/:baseName/:tableName/all',
])
@Delete(['/api/v1/db/data/bulk/:orgs/:baseName/:tableName/all'])
@Acl('bulkDataDeleteAll')
async bulkDataDeleteAll(
@Request() req,

8
packages/nocodb/src/controllers/data-alias-nested.controller.ts

@ -19,9 +19,7 @@ export class DataAliasNestedController {
constructor(private dataAliasNestedService: DataAliasNestedService) {}
// todo: handle case where the given column is not ltar
@Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/mm/:columnName',
])
@Get(['/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/mm/:columnName'])
@Acl('mmList')
async mmList(
@Request() req,
@ -101,9 +99,7 @@ export class DataAliasNestedController {
// todo: handle case where the given column is not ltar
@Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/hm/:columnName',
])
@Get(['/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/hm/:columnName'])
@Acl('hmList')
async hmList(
@Request() req,

2
packages/nocodb/src/models/Base.ts

@ -387,7 +387,7 @@ export default class Base implements BaseType {
return baseData?.id && this.get(baseData?.id, ncMeta);
}
static async getByTitleOrId(titleOrId: string, ncMeta = Noco.ncMeta) {
static async getByTitleOrId(titleOrId: string, ncMeta = Noco.ncMeta) {
const baseId =
titleOrId &&
(await NocoCache.get(

35
packages/nocodb/src/services/api-docs/swagger/templates/paths.ts

@ -446,28 +446,29 @@ export const getModelPaths = async (ctx: {
: {}),
}
: {}),
[`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/export/{type}`]: {
parameters: [exportTypeParam],
get: {
summary: 'Rows export',
operationId: `${ctx.tableName.toLowerCase()}-csv-export`,
description:
'Export all the records from a table.Currently we are only supports `csv` export.',
tags: [ctx.tableName],
responses: {
'200': {
description: 'OK',
content: {
'application/octet-stream': {
schema: {},
[`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/export/{type}`]:
{
parameters: [exportTypeParam],
get: {
summary: 'Rows export',
operationId: `${ctx.tableName.toLowerCase()}-csv-export`,
description:
'Export all the records from a table.Currently we are only supports `csv` export.',
tags: [ctx.tableName],
responses: {
'200': {
description: 'OK',
content: {
'application/octet-stream': {
schema: {},
},
},
headers: csvExportResponseHeader,
},
headers: csvExportResponseHeader,
},
parameters: [csvExportOffsetParam],
},
parameters: [csvExportOffsetParam],
},
},
});
export const getViewPaths = async (ctx: {

Loading…
Cancel
Save