chore: add ticket module and tickets entity
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { Body, Controller, Get, Patch, Post } from "@nestjs/common";
|
||||
import { Body, Controller, Get, HttpCode, HttpStatus, Patch, Post } from "@nestjs/common";
|
||||
import { ApiOperation, ApiTags } from "@nestjs/swagger";
|
||||
|
||||
import { CheckValidityDTO } from "./DTO/check-validity.dto";
|
||||
import { UpdateProfileDto } from "./DTO/update-profile.dto";
|
||||
import { User } from "./entities/user.entity";
|
||||
import { UsersService } from "./providers/users.service";
|
||||
import { AuthGuards } from "../../common/decorators/auth-guard.decorator";
|
||||
@@ -19,13 +20,18 @@ export class UsersController {
|
||||
return this.usersService.getMe(user.id);
|
||||
}
|
||||
|
||||
@AuthGuards()
|
||||
@ApiOperation({ summary: "Update user profile" })
|
||||
@Patch("update-profile")
|
||||
updateProfile() {}
|
||||
updateProfile(@Body() updateProfileDto: UpdateProfileDto, @UserDec() user: User) {
|
||||
return this.usersService.updateProfile(user.id, updateProfileDto);
|
||||
}
|
||||
|
||||
@AuthGuards()
|
||||
@ApiOperation({ summary: "Check validity of user field" })
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@Post("check-validity")
|
||||
checkValidity(@Body() checkValidityDto: CheckValidityDTO) {
|
||||
return this.usersService.checkValidity(checkValidityDto);
|
||||
checkValidity(@Body() checkValidityDto: CheckValidityDTO, @UserDec() user: User) {
|
||||
return this.usersService.checkValidity(checkValidityDto, user.id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user