Browse Source

feat: OldDatasController - dataList

pull/5444/head
Wing-Kam Wong 2 years ago committed by Pranav C
parent
commit
d976304bd8
  1. 36
      packages/nocodb-nest/src/modules/datas/old-datas/old-datas.controller.ts

36
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,
});
}
}

Loading…
Cancel
Save