swagger
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { applyDecorators } from '@nestjs/common';
|
||||
import { ApiBearerAuth, ApiOperation } from '@nestjs/swagger';
|
||||
import { SWAGGER_JWT_AUTH } from '../swagger.setup';
|
||||
|
||||
export function ApiPublicEndpoint(summary?: string) {
|
||||
return applyDecorators(
|
||||
ApiOperation({
|
||||
summary,
|
||||
security: [],
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export function ApiProtectedEndpoint(summary?: string) {
|
||||
return applyDecorators(
|
||||
ApiBearerAuth(SWAGGER_JWT_AUTH),
|
||||
...(summary ? [ApiOperation({ summary })] : []),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user