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

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

@ -19,9 +19,7 @@ export class DataAliasNestedController {
constructor(private dataAliasNestedService: DataAliasNestedService) {} constructor(private dataAliasNestedService: DataAliasNestedService) {}
// todo: handle case where the given column is not ltar // todo: handle case where the given column is not ltar
@Get([ @Get(['/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/mm/:columnName'])
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/mm/:columnName',
])
@Acl('mmList') @Acl('mmList')
async mmList( async mmList(
@Request() req, @Request() req,
@ -101,9 +99,7 @@ export class DataAliasNestedController {
// todo: handle case where the given column is not ltar // todo: handle case where the given column is not ltar
@Get([ @Get(['/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/hm/:columnName'])
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/hm/:columnName',
])
@Acl('hmList') @Acl('hmList')
async hmList( async hmList(
@Request() req, @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); 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 = const baseId =
titleOrId && titleOrId &&
(await NocoCache.get( (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}`]: { [`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/export/{type}`]:
parameters: [exportTypeParam], {
get: { parameters: [exportTypeParam],
summary: 'Rows export', get: {
operationId: `${ctx.tableName.toLowerCase()}-csv-export`, summary: 'Rows export',
description: operationId: `${ctx.tableName.toLowerCase()}-csv-export`,
'Export all the records from a table.Currently we are only supports `csv` export.', description:
tags: [ctx.tableName], 'Export all the records from a table.Currently we are only supports `csv` export.',
responses: { tags: [ctx.tableName],
'200': { responses: {
description: 'OK', '200': {
content: { description: 'OK',
'application/octet-stream': { content: {
schema: {}, 'application/octet-stream': {
schema: {},
},
}, },
headers: csvExportResponseHeader,
}, },
headers: csvExportResponseHeader,
}, },
parameters: [csvExportOffsetParam],
}, },
parameters: [csvExportOffsetParam],
}, },
},
}); });
export const getViewPaths = async (ctx: { export const getViewPaths = async (ctx: {

Loading…
Cancel
Save