chore: add user get profile and check validity route
This commit is contained in:
@@ -1,6 +1,31 @@
|
||||
import { Controller } from "@nestjs/common";
|
||||
import { ApiTags } from "@nestjs/swagger";
|
||||
import { Body, Controller, Get, Patch, Post } from "@nestjs/common";
|
||||
import { ApiOperation, ApiTags } from "@nestjs/swagger";
|
||||
|
||||
import { CheckValidityDTO } from "./DTO/check-validity.dto";
|
||||
import { User } from "./entities/user.entity";
|
||||
import { UsersService } from "./providers/users.service";
|
||||
import { AuthGuards } from "../../common/decorators/auth-guard.decorator";
|
||||
import { UserDec } from "../../common/decorators/user.decorator";
|
||||
|
||||
@Controller("users")
|
||||
@ApiTags("users")
|
||||
export class UsersController {}
|
||||
export class UsersController {
|
||||
constructor(private usersService: UsersService) {}
|
||||
|
||||
@AuthGuards()
|
||||
@ApiOperation({ summary: "Get user profile" })
|
||||
@Get("me")
|
||||
getMe(@UserDec() user: User) {
|
||||
return this.usersService.getMe(user.id);
|
||||
}
|
||||
|
||||
@Patch("update-profile")
|
||||
updateProfile() {}
|
||||
|
||||
@AuthGuards()
|
||||
@ApiOperation({ summary: "Check validity of user field" })
|
||||
@Post("check-validity")
|
||||
checkValidity(@Body() checkValidityDto: CheckValidityDTO) {
|
||||
return this.usersService.checkValidity(checkValidityDto);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user