File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change 7
7
Patch ,
8
8
Post ,
9
9
Query ,
10
+ UseGuards ,
10
11
} from '@nestjs/common' ;
12
+ import { AuthGuard } from '@nestjs/passport' ;
11
13
import { CreateTaskDto } from './dto/create-task.dto' ;
12
14
import { GetTasksFilterDto } from './dto/get-tasks-filter.dto' ;
13
15
import { UpdateTaskStatusDto } from './dto/update-task-status.dto' ;
@@ -16,6 +18,7 @@ import { Task } from './task.entity';
16
18
import { TasksService } from './tasks.service' ;
17
19
18
20
@Controller ( 'tasks' )
21
+ @UseGuards ( AuthGuard ( ) )
19
22
export class TasksController {
20
23
constructor ( private tasksService : TasksService ) { }
21
24
Original file line number Diff line number Diff line change 1
1
import { Module } from '@nestjs/common' ;
2
2
import { TypeOrmModule } from '@nestjs/typeorm' ;
3
+ import { AuthModule } from 'src/auth/auth.module' ;
3
4
import { TasksController } from './tasks.controller' ;
4
5
import { TasksRepository } from './tasks.repository' ;
5
6
import { TasksService } from './tasks.service' ;
6
7
7
8
@Module ( {
8
- imports : [ TypeOrmModule . forFeature ( [ TasksRepository ] ) ] ,
9
+ imports : [ TypeOrmModule . forFeature ( [ TasksRepository ] ) , AuthModule ] ,
9
10
controllers : [ TasksController ] ,
10
11
providers : [ TasksService ] ,
11
12
} )
You can’t perform that action at this time.
0 commit comments