mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
refactor(nestjs): resource meta endpoint
This commit is contained in:
20
packages/server/src/modules/Views/Views.controller.ts
Normal file
20
packages/server/src/modules/Views/Views.controller.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Controller, Get, Param } from '@nestjs/common';
|
||||
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||
import { GetResourceViewsService } from './GetResourceViews.service';
|
||||
|
||||
@Controller('views')
|
||||
@ApiTags('views')
|
||||
export class ViewsController {
|
||||
constructor(
|
||||
private readonly getResourceViewsService: GetResourceViewsService,
|
||||
) {}
|
||||
|
||||
@Get('/resource/:resourceModel')
|
||||
@ApiResponse({ status: 200, description: 'Specific resource views' })
|
||||
@ApiOperation({ summary: 'Get the given resource views' })
|
||||
async getResourceViews(@Param('resourceModel') resourceModel: string) {
|
||||
const views =
|
||||
await this.getResourceViewsService.getResourceViews(resourceModel);
|
||||
return { views };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user