removing public decorator in api (#11)
This commit was merged in pull request #11.
This commit is contained in:
@@ -12,13 +12,14 @@ import {
|
||||
import { ProjectDto } from './project.dto';
|
||||
import { Project } from './project.entity';
|
||||
import { ProjectService } from './project.service';
|
||||
import { CustomError, Public } from '@noahspan/noahspan-modules';
|
||||
import { AuthGuard, CustomError, Public } from '@noahspan/noahspan-modules';
|
||||
|
||||
@Controller('projects')
|
||||
export class ProjectController {
|
||||
constructor(private readonly projectService: ProjectService) {}
|
||||
|
||||
@Get(':partitionKey/:rowKey')
|
||||
@UseGuards(AuthGuard)
|
||||
async find(
|
||||
@Param('partitionKey') partitionKey: string,
|
||||
@Param('rowKey') rowKey: string
|
||||
@@ -32,12 +33,12 @@ export class ProjectController {
|
||||
}
|
||||
}
|
||||
|
||||
@Public()
|
||||
@Get()
|
||||
async findAll() {
|
||||
try {
|
||||
return await this.projectService.findAll();
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
const customError = error as CustomError;
|
||||
|
||||
throw new HttpException(customError.message, customError.statusCode);
|
||||
@@ -45,6 +46,7 @@ export class ProjectController {
|
||||
}
|
||||
|
||||
@Post()
|
||||
@UseGuards(AuthGuard)
|
||||
async create(@Body() projectDto: ProjectDto) {
|
||||
try {
|
||||
const project = new Project();
|
||||
@@ -60,6 +62,7 @@ export class ProjectController {
|
||||
}
|
||||
|
||||
@Put(':partitionKey/:rowKey')
|
||||
@UseGuards(AuthGuard)
|
||||
async update(
|
||||
@Param('partitionKey') partitionKey: string,
|
||||
@Param('rowKey') rowKey: string,
|
||||
@@ -79,6 +82,7 @@ export class ProjectController {
|
||||
}
|
||||
|
||||
@Delete(':partitionKey/:rowKey')
|
||||
@UseGuards(AuthGuard)
|
||||
async delete(
|
||||
@Param('partitionKey') partitionKey: string,
|
||||
@Param('rowKey') rowKey: string
|
||||
|
||||
Reference in New Issue
Block a user