add get user
This commit is contained in:
@@ -9,7 +9,8 @@ import {
|
||||
Put,
|
||||
Request,
|
||||
UseGuards,
|
||||
Delete
|
||||
Delete,
|
||||
ParseIntPipe
|
||||
} from '@nestjs/common';
|
||||
import { AuthGuard } from './auth.guard';
|
||||
import { AuthService } from './auth.service';
|
||||
@@ -38,9 +39,14 @@ export class AuthController {
|
||||
}
|
||||
|
||||
//@UseGuards(AuthGuard)
|
||||
@Get('profile')
|
||||
async getProfile(@Request() req) {
|
||||
return req.user;
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.authService.findAll();
|
||||
}
|
||||
|
||||
@Get(':id_user')
|
||||
async profile(@Param('id_user', ParseIntPipe) id_user: number) {
|
||||
return this.authService.profile(id_user);
|
||||
}
|
||||
|
||||
//@UseGuards(AuthGuard)
|
||||
|
||||
Reference in New Issue
Block a user