fixing update auto id
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
ParseIntPipe,
|
||||
Query,
|
||||
Logger,
|
||||
Req,
|
||||
} from '@nestjs/common';
|
||||
import { AuthGuard } from './auth.guard';
|
||||
import { AuthService } from './auth.service';
|
||||
@@ -36,7 +37,7 @@ export class AuthController {
|
||||
|
||||
//@UseGuards()
|
||||
@Post('register')
|
||||
//@Roles(Role.Admin)
|
||||
@Roles(Role.Admin)
|
||||
async register(@Body() data: registerDto) {
|
||||
Logger.debug('register user');
|
||||
return this.authService.register(data);
|
||||
@@ -73,9 +74,12 @@ export class AuthController {
|
||||
async update(
|
||||
@Param('id_usuario') id_usuario: number,
|
||||
@Body() data: registerDto,
|
||||
@Req() req: any
|
||||
) {
|
||||
Logger.debug('update user');
|
||||
return this.authService.update(id_usuario, data);
|
||||
const authHeader = req.headers['authorization'];
|
||||
const [, token] = authHeader.split(' ');
|
||||
|
||||
return this.authService.update(id_usuario, data, token);
|
||||
}
|
||||
|
||||
//@UseGuards(AuthGuard)
|
||||
|
||||
Reference in New Issue
Block a user