mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 04:10:32 +00:00
21 lines
724 B
TypeScript
21 lines
724 B
TypeScript
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 };
|
|
}
|
|
}
|