diff --git a/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.controller.ts b/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.controller.ts index 63abf5ee96..2e24579121 100644 --- a/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.controller.ts +++ b/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.controller.ts @@ -1,7 +1,35 @@ -import { Controller, UseGuards } from '@nestjs/common' -import { ExtractProjectIdMiddleware } from '../../../middlewares/extract-project-id/extract-project-id.middleware' -import { AuthGuard } from '@nestjs/passport' +import { + Controller, + UseGuards, + Body, + Delete, + Get, + Param, + Patch, + Post, + Request, +} from '@nestjs/common'; +import { + Acl, + ExtractProjectIdMiddleware, +} from '../../../middlewares/extract-project-id/extract-project-id.middleware'; +import { AuthGuard } from '@nestjs/passport'; +import { DatasService } from '../datas.service'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) -export class OldDatasController {} +export class OldDatasController { + constructor(private readonly datasService: DatasService) {} + + @Get('/nc/:projectId/api/v1/:tableName') + @Acl('dataList') + async dataList(@Request() req) { + const { model, view } = + await this.datasService.getViewAndModelFromRequestByAliasOrId(req); + return await this.datasService.getDataList({ + model, + view, + query: req.query, + }); + } +}