Browse Source

refactor: update apis path

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5901/head
Pranav C 1 year ago
parent
commit
7adece9931
  1. 10
      packages/nocodb/src/controllers/data-table.controller.ts

10
packages/nocodb/src/controllers/data-table.controller.ts

@ -26,7 +26,7 @@ export class DataTableController {
constructor(private readonly dataTableService: DataTableService) {} constructor(private readonly dataTableService: DataTableService) {}
// todo: Handle the error case where view doesnt belong to model // todo: Handle the error case where view doesnt belong to model
@Get('/api/v1/tables/:modelId') @Get('/api/v1/tables/:modelId/rows')
@Acl('dataList') @Acl('dataList')
async dataList( async dataList(
@Request() req, @Request() req,
@ -45,7 +45,7 @@ export class DataTableController {
res.json(responseData); res.json(responseData);
} }
@Get(['/api/v1/tables/:modelId/count']) @Get(['/api/v1/tables/:modelId/rows/count'])
@Acl('dataCount') @Acl('dataCount')
async dataCount( async dataCount(
@Request() req, @Request() req,
@ -62,7 +62,7 @@ export class DataTableController {
res.json(countResult); res.json(countResult);
} }
@Post(['/api/v1/tables/:modelId']) @Post(['/api/v1/tables/:modelId/rows'])
@HttpCode(200) @HttpCode(200)
@Acl('dataInsert') @Acl('dataInsert')
async dataInsert( async dataInsert(
@ -79,7 +79,7 @@ export class DataTableController {
}); });
} }
@Patch(['/api/v1/tables/:modelId']) @Patch(['/api/v1/tables/:modelId/rows'])
@Acl('dataUpdate') @Acl('dataUpdate')
async dataUpdate( async dataUpdate(
@Request() req, @Request() req,
@ -95,7 +95,7 @@ export class DataTableController {
}); });
} }
@Delete(['/api/v1/tables/:modelId']) @Delete(['/api/v1/tables/:modelId/rows'])
@Acl('dataDelete') @Acl('dataDelete')
async dataDelete( async dataDelete(
@Request() req, @Request() req,

Loading…
Cancel
Save