mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-24 01:27:56 +00:00
Refactor middleware to guards for type checking
This commit is contained in:
@@ -16,6 +16,7 @@ import { JwtAuthGuard } from '../../../libs/common/src/guards/jwt.auth.guard';
|
||||
import { AddUnitDto } from '../dtos/add.unit.dto';
|
||||
import { GetUnitChildDto } from '../dtos/get.unit.dto';
|
||||
import { UpdateUnitNameDto } from '../dtos/update.unit.dto';
|
||||
import { CheckFloorTypeGuard } from 'src/guards/floor.type.guard';
|
||||
|
||||
@ApiTags('Unit Module')
|
||||
@Controller({
|
||||
@@ -26,7 +27,7 @@ export class UnitController {
|
||||
constructor(private readonly unitService: UnitService) {}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@UseGuards(JwtAuthGuard, CheckFloorTypeGuard)
|
||||
@Post()
|
||||
async addUnit(@Body() addUnitDto: AddUnitDto) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user