mirror of https://github.com/nocodb/nocodb
Wing-Kam Wong
2 years ago
committed by
Pranav C
1 changed files with 32 additions and 4 deletions
@ -1,7 +1,35 @@ |
|||||||
import { Controller, UseGuards } from '@nestjs/common' |
import { |
||||||
import { ExtractProjectIdMiddleware } from '../../../middlewares/extract-project-id/extract-project-id.middleware' |
Controller, |
||||||
import { AuthGuard } from '@nestjs/passport' |
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() |
@Controller() |
||||||
@UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) |
@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…
Reference in new issue