From b27eb3436b7887bfa28baf8b29222da0a319710f Mon Sep 17 00:00:00 2001 From: Wanderson Santos <81826043+wandersonDeve@users.noreply.github.com> Date: Sun, 1 Oct 2023 11:52:48 -0300 Subject: [PATCH 1/3] lint: format files --- src/modules/auth/auth.controller.ts | 14 +--- src/modules/company/company.controller.ts | 7 +- .../dtos/decorators/match.decorator.ts | 2 +- .../company/dtos/update-my-password.dto.ts | 6 +- src/modules/jobs/jobs.controller.ts | 8 +- src/modules/mails/mail.module.ts | 4 +- .../user/decorators/match.decorator.ts | 52 ++++++------- .../user/dtos/update-my-password.dto.ts | 6 +- .../user/services/find-one-user.service.ts | 3 +- .../Swagger/decorators/auth/login.swagger.ts | 40 +++++----- .../decorators/auth/user-logged.swagger.ts | 42 +++++----- .../comment/create-comment.swagger.ts | 16 ++-- .../comment/delete-commentary.swagger.ts | 16 ++-- .../comment/get-all-commentaries.swagger.ts | 16 ++-- .../comment/get-one-commentary.swagger.ts | 16 ++-- .../comment/update-commentary.swagger.ts | 16 ++-- .../company/activate-company.swagger.ts | 40 +++++----- .../company/create-company.swagger.ts | 52 ++++++------- .../company/delete-company-by-id.swagger.ts | 52 ++++++------- .../company/get-all-companies.swagger.ts | 52 ++++++------- .../company/get-company-by-id.swagger.ts | 48 ++++++------ .../recovery-password-by-email.swagger.ts | 52 ++++++------- .../company/update-company-by-id.swagger.ts | 76 +++++++++---------- ...e-password-after-recovery-email.swagger.ts | 52 ++++++------- .../company/update-password.swagger.ts | 52 ++++++------- .../curriculum/upload-curriculum.swagger.ts | 35 +++++---- .../decorators/jobs/archive-job.swagger.ts | 16 ++-- .../decorators/jobs/create-new-job.swagger.ts | 56 +++++++------- ...all-jobs-of-logged-company.swagger copy.ts | 20 ++--- .../get-all-jobs-of-logged-company.swagger.ts | 20 ++--- .../decorators/jobs/get-one-job.swagger.ts | 16 ++-- .../decorators/jobs/search-job.swagger.ts | 18 ++--- .../decorators/jobs/update-job.swagger.ts | 16 ++-- .../reports/create-report.swagger.ts | 16 ++-- .../reports/delete-report.swagger.ts | 16 ++-- .../reports/get-all-reports.swagger.ts | 16 ++-- .../reports/get-report-by-id.swagger.ts | 16 ++-- .../reports/update-report.swagger.ts | 16 ++-- .../decorators/upload/upload.swagger.ts | 37 +++++---- .../user/classes/create-response.swagger.ts | 2 +- .../user/classes/list-response.swagger.ts | 2 +- .../user/classes/recovery-password.swagger.ts | 2 +- .../user/delete-user.swagger.decorator.ts | 50 ++++++------ .../user/get-user-adm.swagger.decorator.ts | 3 +- .../user/get-user.swagger.decorator.ts | 4 +- .../recover-by-email.swagger.decorator.ts | 43 +++++------ ...-after-email-recovery.swagger.decorator.ts | 42 +++++----- .../user/update-password.swagger.decorator.ts | 42 +++++----- .../user/update-user.swagger.decorator.ts | 72 +++++++++--------- .../user/view-users.swagger.decorator.ts | 43 +++++------ 50 files changed, 669 insertions(+), 690 deletions(-) diff --git a/src/modules/auth/auth.controller.ts b/src/modules/auth/auth.controller.ts index 90df304..41f2167 100644 --- a/src/modules/auth/auth.controller.ts +++ b/src/modules/auth/auth.controller.ts @@ -1,16 +1,6 @@ -import { - Body, - Controller, - Get, - Post, - Res, - UseGuards -} from '@nestjs/common'; +import { Body, Controller, Get, Post, Res, UseGuards } from '@nestjs/common'; import { AuthGuard } from '@nestjs/passport'; -import { - ApiBearerAuth, - ApiTags -} from '@nestjs/swagger'; +import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; import { Response } from 'express'; import { LoginSwagger } from 'src/shared/Swagger/decorators/auth/login.swagger'; import { UserLoggedSwagger } from 'src/shared/Swagger/decorators/auth/user-logged.swagger'; diff --git a/src/modules/company/company.controller.ts b/src/modules/company/company.controller.ts index 634f18d..75b227e 100644 --- a/src/modules/company/company.controller.ts +++ b/src/modules/company/company.controller.ts @@ -11,14 +11,11 @@ import { Res, UploadedFile, UseGuards, - UseInterceptors + UseInterceptors, } from '@nestjs/common'; import { AuthGuard } from '@nestjs/passport'; import { FileInterceptor } from '@nestjs/platform-express'; -import { - ApiBearerAuth, - ApiTags -} from '@nestjs/swagger'; +import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; import { Response } from 'express'; import { CompaniesEntity } from 'src/database/entities/companies.entity'; import { ActivateCompanySwagger } from 'src/shared/Swagger/decorators/company/activate-company.swagger'; diff --git a/src/modules/company/dtos/decorators/match.decorator.ts b/src/modules/company/dtos/decorators/match.decorator.ts index f0450d4..46ca915 100644 --- a/src/modules/company/dtos/decorators/match.decorator.ts +++ b/src/modules/company/dtos/decorators/match.decorator.ts @@ -25,4 +25,4 @@ export class MatchConstraint implements ValidatorConstraintInterface { const relatedValue = (args.object as any)[relatedPropertyName]; return value === relatedValue; } -} \ No newline at end of file +} diff --git a/src/modules/company/dtos/update-my-password.dto.ts b/src/modules/company/dtos/update-my-password.dto.ts index 75ef962..bc181b1 100644 --- a/src/modules/company/dtos/update-my-password.dto.ts +++ b/src/modules/company/dtos/update-my-password.dto.ts @@ -11,7 +11,8 @@ export class UpdateMyPasswordDto { @IsNotEmpty({ message: "O campo 'password' não pode ficar vazio" }) @Length(8, 50) @Matches(/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/, { - message: 'A senha precisa ter no mínimo 8 caracteres, máximo de 50, uma letra maiúscula, um número e um símbolo.', + message: + 'A senha precisa ter no mínimo 8 caracteres, máximo de 50, uma letra maiúscula, um número e um símbolo.', }) @ApiProperty({ description: 'Senha de Login', @@ -23,7 +24,8 @@ export class UpdateMyPasswordDto { @IsNotEmpty({ message: "O campo 'confirmPassword' não pode ficar vazio" }) @Length(8, 50) @Matches(/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/, { - message: 'A senha precisa ter no mínimo 8 caracteres, máximo de 50, uma letra maiúscula, um número e um símbolo.', + message: + 'A senha precisa ter no mínimo 8 caracteres, máximo de 50, uma letra maiúscula, um número e um símbolo.', }) @ApiProperty({ description: 'Senha de Login', diff --git a/src/modules/jobs/jobs.controller.ts b/src/modules/jobs/jobs.controller.ts index 69e248c..4b4877e 100644 --- a/src/modules/jobs/jobs.controller.ts +++ b/src/modules/jobs/jobs.controller.ts @@ -8,14 +8,10 @@ import { Post, Put, Query, - UseGuards + UseGuards, } from '@nestjs/common'; import { AuthGuard } from '@nestjs/passport'; -import { - ApiBearerAuth, - ApiOperation, - ApiTags -} from '@nestjs/swagger'; +import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger'; import { ArchiveJobSwagger } from 'src/shared/Swagger/decorators/jobs/archive-job.swagger'; import { CreateNewJobSwagger } from 'src/shared/Swagger/decorators/jobs/create-new-job.swagger'; import { GetOneJobSwagger } from 'src/shared/Swagger/decorators/jobs/get-one-job.swagger'; diff --git a/src/modules/mails/mail.module.ts b/src/modules/mails/mail.module.ts index 6cf6f38..3362e96 100644 --- a/src/modules/mails/mail.module.ts +++ b/src/modules/mails/mail.module.ts @@ -19,8 +19,8 @@ import { MailService } from './mail.service'; pass: config.get('MAIL_PASSWORD'), }, tls: { - rejectUnauthorized: false - } + rejectUnauthorized: false, + }, }, defaults: { from: `no-reply `, diff --git a/src/modules/user/decorators/match.decorator.ts b/src/modules/user/decorators/match.decorator.ts index 576a995..46ca915 100644 --- a/src/modules/user/decorators/match.decorator.ts +++ b/src/modules/user/decorators/match.decorator.ts @@ -1,28 +1,28 @@ import { - registerDecorator, - ValidationArguments, - ValidationOptions, - ValidatorConstraint, - ValidatorConstraintInterface, - } from 'class-validator'; - - export function Match(property: string, validationOptions?: ValidationOptions) { - return (object: any, propertyName: string) => { - registerDecorator({ - target: object.constructor, - propertyName, - options: validationOptions, - constraints: [property], - validator: MatchConstraint, - }); - }; + registerDecorator, + ValidationArguments, + ValidationOptions, + ValidatorConstraint, + ValidatorConstraintInterface, +} from 'class-validator'; + +export function Match(property: string, validationOptions?: ValidationOptions) { + return (object: any, propertyName: string) => { + registerDecorator({ + target: object.constructor, + propertyName, + options: validationOptions, + constraints: [property], + validator: MatchConstraint, + }); + }; +} + +@ValidatorConstraint({ name: 'Match' }) +export class MatchConstraint implements ValidatorConstraintInterface { + validate(value: any, args: ValidationArguments) { + const [relatedPropertyName] = args.constraints; + const relatedValue = (args.object as any)[relatedPropertyName]; + return value === relatedValue; } - - @ValidatorConstraint({ name: 'Match' }) - export class MatchConstraint implements ValidatorConstraintInterface { - validate(value: any, args: ValidationArguments) { - const [relatedPropertyName] = args.constraints; - const relatedValue = (args.object as any)[relatedPropertyName]; - return value === relatedValue; - } - } \ No newline at end of file +} diff --git a/src/modules/user/dtos/update-my-password.dto.ts b/src/modules/user/dtos/update-my-password.dto.ts index 39f041b..764936f 100644 --- a/src/modules/user/dtos/update-my-password.dto.ts +++ b/src/modules/user/dtos/update-my-password.dto.ts @@ -40,7 +40,8 @@ export class CreatePasswordHashDto { message: 'Senha muito fraca', }) @ApiProperty({ - description: 'A senha precisa ter no mínimo 8 caracteres, máximo de 50, uma letra maiúscula, um número e um símbolo.', + description: + 'A senha precisa ter no mínimo 8 caracteres, máximo de 50, uma letra maiúscula, um número e um símbolo.', example: 'Abcd@1234', }) password: string; @@ -48,7 +49,8 @@ export class CreatePasswordHashDto { @IsString() @Length(8, 50) @Matches(/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/, { - message: 'A senha precisa ter no mínimo 8 caracteres, máximo de 50, uma letra maiúscula, um número e um símbolo.', + message: + 'A senha precisa ter no mínimo 8 caracteres, máximo de 50, uma letra maiúscula, um número e um símbolo.', }) @ApiProperty({ description: 'Confirmação de senha de Login', diff --git a/src/modules/user/services/find-one-user.service.ts b/src/modules/user/services/find-one-user.service.ts index 6d4c3b1..8049491 100644 --- a/src/modules/user/services/find-one-user.service.ts +++ b/src/modules/user/services/find-one-user.service.ts @@ -6,8 +6,7 @@ export class FindOneUserService { constructor(public userRepository: UserRepository) {} async execute(id: string) { - - const userExists = await this.userRepository.findOneById(id) + const userExists = await this.userRepository.findOneById(id); delete userExists.password; delete userExists.type; diff --git a/src/shared/Swagger/decorators/auth/login.swagger.ts b/src/shared/Swagger/decorators/auth/login.swagger.ts index 014537e..ebfa5ec 100644 --- a/src/shared/Swagger/decorators/auth/login.swagger.ts +++ b/src/shared/Swagger/decorators/auth/login.swagger.ts @@ -1,22 +1,22 @@ -import { HttpStatus, applyDecorators } from "@nestjs/common"; -import { ApiOperation, ApiResponse } from "@nestjs/swagger"; -import { UserLoginResponseDto } from "src/modules/auth/dtos/user-login-response.dto"; -import { BadRequestSwagger } from "../../bad-request.swagger"; +import { HttpStatus, applyDecorators } from '@nestjs/common'; +import { ApiOperation, ApiResponse } from '@nestjs/swagger'; +import { UserLoginResponseDto } from 'src/modules/auth/dtos/user-login-response.dto'; +import { BadRequestSwagger } from '../../bad-request.swagger'; export function LoginSwagger() { - return applyDecorators( - ApiResponse({ - status: HttpStatus.OK, - description: 'Exemplo do retorno de sucesso da rota', - type: UserLoginResponseDto, - }), - ApiResponse({ - status: HttpStatus.BAD_REQUEST, - description: 'Modelo de erro', - type: BadRequestSwagger, - }), - ApiOperation({ - summary: 'Rota para fazer login na plataforma', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiResponse({ + status: HttpStatus.OK, + description: 'Exemplo do retorno de sucesso da rota', + type: UserLoginResponseDto, + }), + ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: 'Modelo de erro', + type: BadRequestSwagger, + }), + ApiOperation({ + summary: 'Rota para fazer login na plataforma', + }), + ); +} diff --git a/src/shared/Swagger/decorators/auth/user-logged.swagger.ts b/src/shared/Swagger/decorators/auth/user-logged.swagger.ts index a2a2e69..0df2e8e 100644 --- a/src/shared/Swagger/decorators/auth/user-logged.swagger.ts +++ b/src/shared/Swagger/decorators/auth/user-logged.swagger.ts @@ -1,22 +1,22 @@ -import { HttpStatus, applyDecorators } from "@nestjs/common"; -import { ApiOperation, ApiResponse } from "@nestjs/swagger"; -import { LoggerUserType } from "src/modules/auth/types/logged-user.types"; -import { UnauthorizedSwagger } from "../../unauthorized.swagger"; +import { HttpStatus, applyDecorators } from '@nestjs/common'; +import { ApiOperation, ApiResponse } from '@nestjs/swagger'; +import { LoggerUserType } from 'src/modules/auth/types/logged-user.types'; +import { UnauthorizedSwagger } from '../../unauthorized.swagger'; -export function UserLoggedSwagger(){ - return applyDecorators( - ApiResponse({ - status: HttpStatus.OK, - description: 'Exemplo do retorno de sucesso da rota', - type: LoggerUserType, - }), - ApiResponse({ - status: HttpStatus.UNAUTHORIZED, - description: 'Modelo de erro', - type: UnauthorizedSwagger, - }), - ApiOperation({ - summary: 'Retorna usuário logado', - }) - ) -} \ No newline at end of file +export function UserLoggedSwagger() { + return applyDecorators( + ApiResponse({ + status: HttpStatus.OK, + description: 'Exemplo do retorno de sucesso da rota', + type: LoggerUserType, + }), + ApiResponse({ + status: HttpStatus.UNAUTHORIZED, + description: 'Modelo de erro', + type: UnauthorizedSwagger, + }), + ApiOperation({ + summary: 'Retorna usuário logado', + }), + ); +} diff --git a/src/shared/Swagger/decorators/comment/create-comment.swagger.ts b/src/shared/Swagger/decorators/comment/create-comment.swagger.ts index f00bece..90402fd 100644 --- a/src/shared/Swagger/decorators/comment/create-comment.swagger.ts +++ b/src/shared/Swagger/decorators/comment/create-comment.swagger.ts @@ -1,10 +1,10 @@ -import { applyDecorators } from "@nestjs/common"; -import { ApiOperation } from "@nestjs/swagger"; +import { applyDecorators } from '@nestjs/common'; +import { ApiOperation } from '@nestjs/swagger'; export function CreateCommentSwagger() { - return applyDecorators( - ApiOperation({ - summary: 'Cadastrar um comentário.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiOperation({ + summary: 'Cadastrar um comentário.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/comment/delete-commentary.swagger.ts b/src/shared/Swagger/decorators/comment/delete-commentary.swagger.ts index 8aa8296..365810e 100644 --- a/src/shared/Swagger/decorators/comment/delete-commentary.swagger.ts +++ b/src/shared/Swagger/decorators/comment/delete-commentary.swagger.ts @@ -1,10 +1,10 @@ -import { applyDecorators } from "@nestjs/common"; -import { ApiOperation } from "@nestjs/swagger"; +import { applyDecorators } from '@nestjs/common'; +import { ApiOperation } from '@nestjs/swagger'; export function DeleteCommentarySwagger() { - return applyDecorators( - ApiOperation({ - summary: 'Excluir um comentário por id.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiOperation({ + summary: 'Excluir um comentário por id.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/comment/get-all-commentaries.swagger.ts b/src/shared/Swagger/decorators/comment/get-all-commentaries.swagger.ts index a22adac..00ee720 100644 --- a/src/shared/Swagger/decorators/comment/get-all-commentaries.swagger.ts +++ b/src/shared/Swagger/decorators/comment/get-all-commentaries.swagger.ts @@ -1,10 +1,10 @@ -import { applyDecorators } from "@nestjs/common"; -import { ApiOperation } from "@nestjs/swagger"; +import { applyDecorators } from '@nestjs/common'; +import { ApiOperation } from '@nestjs/swagger'; export function GetAllCommentariesSwagger() { - return applyDecorators( - ApiOperation({ - summary: 'Encontrar todos os comentários.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiOperation({ + summary: 'Encontrar todos os comentários.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/comment/get-one-commentary.swagger.ts b/src/shared/Swagger/decorators/comment/get-one-commentary.swagger.ts index d7a9963..d897bd1 100644 --- a/src/shared/Swagger/decorators/comment/get-one-commentary.swagger.ts +++ b/src/shared/Swagger/decorators/comment/get-one-commentary.swagger.ts @@ -1,10 +1,10 @@ -import { applyDecorators } from "@nestjs/common"; -import { ApiOperation } from "@nestjs/swagger"; +import { applyDecorators } from '@nestjs/common'; +import { ApiOperation } from '@nestjs/swagger'; export function GetOneCommentaryByIdSwagger() { - return applyDecorators( - ApiOperation({ - summary: 'Buscar um comentário por id.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiOperation({ + summary: 'Buscar um comentário por id.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/comment/update-commentary.swagger.ts b/src/shared/Swagger/decorators/comment/update-commentary.swagger.ts index c6a309b..52ccff1 100644 --- a/src/shared/Swagger/decorators/comment/update-commentary.swagger.ts +++ b/src/shared/Swagger/decorators/comment/update-commentary.swagger.ts @@ -1,10 +1,10 @@ -import { applyDecorators } from "@nestjs/common"; -import { ApiOperation } from "@nestjs/swagger"; +import { applyDecorators } from '@nestjs/common'; +import { ApiOperation } from '@nestjs/swagger'; export function UpdateCommentarySwagger() { - return applyDecorators( - ApiOperation({ - summary: 'Atualizar um comentário por id.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiOperation({ + summary: 'Atualizar um comentário por id.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/company/activate-company.swagger.ts b/src/shared/Swagger/decorators/company/activate-company.swagger.ts index 4032abb..518d0cc 100644 --- a/src/shared/Swagger/decorators/company/activate-company.swagger.ts +++ b/src/shared/Swagger/decorators/company/activate-company.swagger.ts @@ -1,22 +1,22 @@ -import { HttpStatus, applyDecorators } from "@nestjs/common"; -import { ApiOperation, ApiResponse } from "@nestjs/swagger"; -import { UnauthorizedSwagger } from "../../unauthorized.swagger"; -import { BadRequestSwagger } from "../../bad-request.swagger"; +import { HttpStatus, applyDecorators } from '@nestjs/common'; +import { ApiOperation, ApiResponse } from '@nestjs/swagger'; +import { UnauthorizedSwagger } from '../../unauthorized.swagger'; +import { BadRequestSwagger } from '../../bad-request.swagger'; export function ActivateCompanySwagger() { - return applyDecorators( - ApiResponse({ - status: HttpStatus.UNAUTHORIZED, - description: 'Modelo de erro', - type: UnauthorizedSwagger, - }), - ApiResponse({ - status: HttpStatus.BAD_REQUEST, - description: 'Modelo de erro', - type: BadRequestSwagger, - }), - ApiOperation({ - summary: 'Ativar uma empresa pelo ID', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiResponse({ + status: HttpStatus.UNAUTHORIZED, + description: 'Modelo de erro', + type: UnauthorizedSwagger, + }), + ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: 'Modelo de erro', + type: BadRequestSwagger, + }), + ApiOperation({ + summary: 'Ativar uma empresa pelo ID', + }), + ); +} diff --git a/src/shared/Swagger/decorators/company/create-company.swagger.ts b/src/shared/Swagger/decorators/company/create-company.swagger.ts index 20b0d9e..adb3933 100644 --- a/src/shared/Swagger/decorators/company/create-company.swagger.ts +++ b/src/shared/Swagger/decorators/company/create-company.swagger.ts @@ -1,28 +1,28 @@ -import { HttpStatus, applyDecorators } from "@nestjs/common"; -import { ApiOperation, ApiResponse } from "@nestjs/swagger"; -import { CreateCompanyDto } from "src/modules/company/dtos/create-company.dto"; -import { UnauthorizedSwagger } from "../../unauthorized.swagger"; -import { BadRequestSwagger } from "../../bad-request.swagger"; +import { HttpStatus, applyDecorators } from '@nestjs/common'; +import { ApiOperation, ApiResponse } from '@nestjs/swagger'; +import { CreateCompanyDto } from 'src/modules/company/dtos/create-company.dto'; +import { UnauthorizedSwagger } from '../../unauthorized.swagger'; +import { BadRequestSwagger } from '../../bad-request.swagger'; export function CreateCompanySwagger() { - return applyDecorators( - ApiResponse({ - status: HttpStatus.OK, - description: 'Exemplo do retorno de sucesso da rota', - type: CreateCompanyDto, - }), - ApiResponse({ - status: HttpStatus.UNAUTHORIZED, - description: 'Modelo de erro', - type: UnauthorizedSwagger, - }), - ApiResponse({ - status: HttpStatus.BAD_REQUEST, - description: 'Modelo de erro', - type: BadRequestSwagger, - }), - ApiOperation({ - summary: 'Cadastrar uma empresa.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiResponse({ + status: HttpStatus.OK, + description: 'Exemplo do retorno de sucesso da rota', + type: CreateCompanyDto, + }), + ApiResponse({ + status: HttpStatus.UNAUTHORIZED, + description: 'Modelo de erro', + type: UnauthorizedSwagger, + }), + ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: 'Modelo de erro', + type: BadRequestSwagger, + }), + ApiOperation({ + summary: 'Cadastrar uma empresa.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/company/delete-company-by-id.swagger.ts b/src/shared/Swagger/decorators/company/delete-company-by-id.swagger.ts index 8d81526..bda5d1c 100644 --- a/src/shared/Swagger/decorators/company/delete-company-by-id.swagger.ts +++ b/src/shared/Swagger/decorators/company/delete-company-by-id.swagger.ts @@ -1,28 +1,28 @@ -import { HttpStatus, applyDecorators } from "@nestjs/common"; -import { ApiOperation, ApiResponse } from "@nestjs/swagger"; -import { CompanyIdDto } from "src/modules/company/dtos/company-id.dto"; -import { UnauthorizedSwagger } from "../../unauthorized.swagger"; -import { BadRequestSwagger } from "../../bad-request.swagger"; +import { HttpStatus, applyDecorators } from '@nestjs/common'; +import { ApiOperation, ApiResponse } from '@nestjs/swagger'; +import { CompanyIdDto } from 'src/modules/company/dtos/company-id.dto'; +import { UnauthorizedSwagger } from '../../unauthorized.swagger'; +import { BadRequestSwagger } from '../../bad-request.swagger'; export function DeleteCompanyByIdSwagger() { - return applyDecorators( - ApiResponse({ - status: HttpStatus.OK, - description: 'Exemplo do retorno de sucesso da rota', - type: CompanyIdDto, - }), - ApiResponse({ - status: HttpStatus.UNAUTHORIZED, - description: 'Modelo de erro', - type: UnauthorizedSwagger, - }), - ApiResponse({ - status: HttpStatus.BAD_REQUEST, - description: 'Modelo de erro', - type: BadRequestSwagger, - }), - ApiOperation({ - summary: 'Excluir uma empresa por id.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiResponse({ + status: HttpStatus.OK, + description: 'Exemplo do retorno de sucesso da rota', + type: CompanyIdDto, + }), + ApiResponse({ + status: HttpStatus.UNAUTHORIZED, + description: 'Modelo de erro', + type: UnauthorizedSwagger, + }), + ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: 'Modelo de erro', + type: BadRequestSwagger, + }), + ApiOperation({ + summary: 'Excluir uma empresa por id.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/company/get-all-companies.swagger.ts b/src/shared/Swagger/decorators/company/get-all-companies.swagger.ts index 66b4fb7..a9bf737 100644 --- a/src/shared/Swagger/decorators/company/get-all-companies.swagger.ts +++ b/src/shared/Swagger/decorators/company/get-all-companies.swagger.ts @@ -1,28 +1,28 @@ -import { HttpStatus, applyDecorators } from "@nestjs/common"; -import { ApiOperation, ApiResponse } from "@nestjs/swagger"; -import { BadRequestSwagger } from "../../bad-request.swagger"; -import { UnauthorizedSwagger } from "../../unauthorized.swagger"; -import { PageOptionsDto } from "src/shared/pagination"; +import { HttpStatus, applyDecorators } from '@nestjs/common'; +import { ApiOperation, ApiResponse } from '@nestjs/swagger'; +import { BadRequestSwagger } from '../../bad-request.swagger'; +import { UnauthorizedSwagger } from '../../unauthorized.swagger'; +import { PageOptionsDto } from 'src/shared/pagination'; export function GetAllCompaniesSwagger() { - return applyDecorators( - ApiResponse({ - status: HttpStatus.OK, - description: 'Exemplo do retorno de sucesso da rota', - type: PageOptionsDto, - }), - ApiResponse({ - status: HttpStatus.UNAUTHORIZED, - description: 'Modelo de erro', - type: UnauthorizedSwagger, - }), - ApiResponse({ - status: HttpStatus.BAD_REQUEST, - description: 'Modelo de erro', - type: BadRequestSwagger, - }), - ApiOperation({ - summary: 'Buscar todas as empresas.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiResponse({ + status: HttpStatus.OK, + description: 'Exemplo do retorno de sucesso da rota', + type: PageOptionsDto, + }), + ApiResponse({ + status: HttpStatus.UNAUTHORIZED, + description: 'Modelo de erro', + type: UnauthorizedSwagger, + }), + ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: 'Modelo de erro', + type: BadRequestSwagger, + }), + ApiOperation({ + summary: 'Buscar todas as empresas.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/company/get-company-by-id.swagger.ts b/src/shared/Swagger/decorators/company/get-company-by-id.swagger.ts index 7ca0895..32f635e 100644 --- a/src/shared/Swagger/decorators/company/get-company-by-id.swagger.ts +++ b/src/shared/Swagger/decorators/company/get-company-by-id.swagger.ts @@ -1,26 +1,26 @@ -import { HttpStatus, applyDecorators } from "@nestjs/common"; -import { ApiOperation, ApiParam, ApiResponse } from "@nestjs/swagger"; -import { UnauthorizedSwagger } from "../../unauthorized.swagger"; -import { BadRequestSwagger } from "../../bad-request.swagger"; +import { HttpStatus, applyDecorators } from '@nestjs/common'; +import { ApiOperation, ApiParam, ApiResponse } from '@nestjs/swagger'; +import { UnauthorizedSwagger } from '../../unauthorized.swagger'; +import { BadRequestSwagger } from '../../bad-request.swagger'; export function GetCompanyByIdSwagger() { - return applyDecorators( - ApiParam({ - name: 'id', - type: 'string', - }), - ApiResponse({ - status: HttpStatus.UNAUTHORIZED, - description: 'Modelo de erro', - type: UnauthorizedSwagger, - }), - ApiResponse({ - status: HttpStatus.BAD_REQUEST, - description: 'Modelo de erro', - type: BadRequestSwagger, - }), - ApiOperation({ - summary: 'Buscar uma empresa por id.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiParam({ + name: 'id', + type: 'string', + }), + ApiResponse({ + status: HttpStatus.UNAUTHORIZED, + description: 'Modelo de erro', + type: UnauthorizedSwagger, + }), + ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: 'Modelo de erro', + type: BadRequestSwagger, + }), + ApiOperation({ + summary: 'Buscar uma empresa por id.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/company/recovery-password-by-email.swagger.ts b/src/shared/Swagger/decorators/company/recovery-password-by-email.swagger.ts index 370af5d..e8a6eb8 100644 --- a/src/shared/Swagger/decorators/company/recovery-password-by-email.swagger.ts +++ b/src/shared/Swagger/decorators/company/recovery-password-by-email.swagger.ts @@ -1,28 +1,28 @@ -import { HttpStatus, applyDecorators } from "@nestjs/common"; -import { ApiOperation, ApiResponse } from "@nestjs/swagger"; -import { EmailDto } from "src/modules/user/dtos/email-user.dto"; -import { UnauthorizedSwagger } from "../../unauthorized.swagger"; -import { BadRequestSwagger } from "../../bad-request.swagger"; +import { HttpStatus, applyDecorators } from '@nestjs/common'; +import { ApiOperation, ApiResponse } from '@nestjs/swagger'; +import { EmailDto } from 'src/modules/user/dtos/email-user.dto'; +import { UnauthorizedSwagger } from '../../unauthorized.swagger'; +import { BadRequestSwagger } from '../../bad-request.swagger'; export function RecoverPasswordByEmailSwagger() { - return applyDecorators( - ApiResponse({ - status: HttpStatus.OK, - description: 'Exemplo do retorno de sucesso da rota', - type: EmailDto, - }), - ApiResponse({ - status: HttpStatus.UNAUTHORIZED, - description: 'Modelo de erro', - type: UnauthorizedSwagger, - }), - ApiResponse({ - status: HttpStatus.BAD_REQUEST, - description: 'Modelo de erro', - type: BadRequestSwagger, - }), - ApiOperation({ - summary: 'Send email to recovery password.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiResponse({ + status: HttpStatus.OK, + description: 'Exemplo do retorno de sucesso da rota', + type: EmailDto, + }), + ApiResponse({ + status: HttpStatus.UNAUTHORIZED, + description: 'Modelo de erro', + type: UnauthorizedSwagger, + }), + ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: 'Modelo de erro', + type: BadRequestSwagger, + }), + ApiOperation({ + summary: 'Send email to recovery password.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/company/update-company-by-id.swagger.ts b/src/shared/Swagger/decorators/company/update-company-by-id.swagger.ts index 3489e10..a9b49c1 100644 --- a/src/shared/Swagger/decorators/company/update-company-by-id.swagger.ts +++ b/src/shared/Swagger/decorators/company/update-company-by-id.swagger.ts @@ -1,40 +1,40 @@ -import { HttpStatus, applyDecorators } from "@nestjs/common"; -import { ApiBody, ApiOperation, ApiResponse } from "@nestjs/swagger"; -import { UpdateCompanyDto } from "src/modules/company/dtos/update-company.dto"; -import { UnauthorizedSwagger } from "../../unauthorized.swagger"; -import { BadRequestSwagger } from "../../bad-request.swagger"; +import { HttpStatus, applyDecorators } from '@nestjs/common'; +import { ApiBody, ApiOperation, ApiResponse } from '@nestjs/swagger'; +import { UpdateCompanyDto } from 'src/modules/company/dtos/update-company.dto'; +import { UnauthorizedSwagger } from '../../unauthorized.swagger'; +import { BadRequestSwagger } from '../../bad-request.swagger'; export function UpdateCompanyByIdSwagger() { - return applyDecorators( - ApiBody({ - description: 'Upload images', - schema: { - type: 'object', - properties: { - file: { - type: 'string', - format: 'binary', - }, - }, - }, - }), - ApiResponse({ - status: HttpStatus.OK, - description: 'Exemplo do retorno de sucesso da rota', - type: UpdateCompanyDto, - }), - ApiResponse({ - status: HttpStatus.UNAUTHORIZED, - description: 'Modelo de erro', - type: UnauthorizedSwagger, - }), - ApiResponse({ - status: HttpStatus.BAD_REQUEST, - description: 'Modelo de erro', - type: BadRequestSwagger, - }), - ApiOperation({ - summary: 'Atualizar uma empresa por id.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiBody({ + description: 'Upload images', + schema: { + type: 'object', + properties: { + file: { + type: 'string', + format: 'binary', + }, + }, + }, + }), + ApiResponse({ + status: HttpStatus.OK, + description: 'Exemplo do retorno de sucesso da rota', + type: UpdateCompanyDto, + }), + ApiResponse({ + status: HttpStatus.UNAUTHORIZED, + description: 'Modelo de erro', + type: UnauthorizedSwagger, + }), + ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: 'Modelo de erro', + type: BadRequestSwagger, + }), + ApiOperation({ + summary: 'Atualizar uma empresa por id.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/company/update-password-after-recovery-email.swagger.ts b/src/shared/Swagger/decorators/company/update-password-after-recovery-email.swagger.ts index df7719d..acb9848 100644 --- a/src/shared/Swagger/decorators/company/update-password-after-recovery-email.swagger.ts +++ b/src/shared/Swagger/decorators/company/update-password-after-recovery-email.swagger.ts @@ -1,28 +1,28 @@ -import { HttpStatus, applyDecorators } from "@nestjs/common"; -import { ApiOperation, ApiResponse } from "@nestjs/swagger"; -import { CreatePasswordHashDto } from "src/modules/company/dtos/update-my-password.dto"; -import { UnauthorizedSwagger } from "../../unauthorized.swagger"; -import { BadRequestSwagger } from "../../bad-request.swagger"; +import { HttpStatus, applyDecorators } from '@nestjs/common'; +import { ApiOperation, ApiResponse } from '@nestjs/swagger'; +import { CreatePasswordHashDto } from 'src/modules/company/dtos/update-my-password.dto'; +import { UnauthorizedSwagger } from '../../unauthorized.swagger'; +import { BadRequestSwagger } from '../../bad-request.swagger'; export function UpdatePasswordAfterRecoveryEmailSwagger() { - return applyDecorators( - ApiResponse({ - status: HttpStatus.OK, - description: 'Exemplo do retorno de sucesso da rota', - type: CreatePasswordHashDto, - }), - ApiResponse({ - status: HttpStatus.UNAUTHORIZED, - description: 'Modelo de erro', - type: UnauthorizedSwagger, - }), - ApiResponse({ - status: HttpStatus.BAD_REQUEST, - description: 'Modelo de erro', - type: BadRequestSwagger, - }), - ApiOperation({ - summary: 'Company update password.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiResponse({ + status: HttpStatus.OK, + description: 'Exemplo do retorno de sucesso da rota', + type: CreatePasswordHashDto, + }), + ApiResponse({ + status: HttpStatus.UNAUTHORIZED, + description: 'Modelo de erro', + type: UnauthorizedSwagger, + }), + ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: 'Modelo de erro', + type: BadRequestSwagger, + }), + ApiOperation({ + summary: 'Company update password.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/company/update-password.swagger.ts b/src/shared/Swagger/decorators/company/update-password.swagger.ts index e5650e4..cc8ab0d 100644 --- a/src/shared/Swagger/decorators/company/update-password.swagger.ts +++ b/src/shared/Swagger/decorators/company/update-password.swagger.ts @@ -1,28 +1,28 @@ -import { HttpStatus, applyDecorators } from "@nestjs/common"; -import { CreatePasswordHashDto } from "src/modules/company/dtos/update-my-password.dto"; -import { UnauthorizedSwagger } from "../../unauthorized.swagger"; -import { ApiOperation, ApiResponse } from "@nestjs/swagger"; -import { BadRequestSwagger } from "../../bad-request.swagger"; +import { HttpStatus, applyDecorators } from '@nestjs/common'; +import { CreatePasswordHashDto } from 'src/modules/company/dtos/update-my-password.dto'; +import { UnauthorizedSwagger } from '../../unauthorized.swagger'; +import { ApiOperation, ApiResponse } from '@nestjs/swagger'; +import { BadRequestSwagger } from '../../bad-request.swagger'; export function UpdatePasswordSwagger() { - return applyDecorators( - ApiResponse({ - status: HttpStatus.OK, - description: 'Exemplo do retorno de sucesso da rota', - type: CreatePasswordHashDto, - }), - ApiResponse({ - status: HttpStatus.UNAUTHORIZED, - description: 'Modelo de erro', - type: UnauthorizedSwagger, - }), - ApiResponse({ - status: HttpStatus.BAD_REQUEST, - description: 'Modelo de erro', - type: BadRequestSwagger, - }), - ApiOperation({ - summary: 'Company update password without recovery e-mail.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiResponse({ + status: HttpStatus.OK, + description: 'Exemplo do retorno de sucesso da rota', + type: CreatePasswordHashDto, + }), + ApiResponse({ + status: HttpStatus.UNAUTHORIZED, + description: 'Modelo de erro', + type: UnauthorizedSwagger, + }), + ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: 'Modelo de erro', + type: BadRequestSwagger, + }), + ApiOperation({ + summary: 'Company update password without recovery e-mail.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/curriculum/upload-curriculum.swagger.ts b/src/shared/Swagger/decorators/curriculum/upload-curriculum.swagger.ts index d509d39..7818d0b 100644 --- a/src/shared/Swagger/decorators/curriculum/upload-curriculum.swagger.ts +++ b/src/shared/Swagger/decorators/curriculum/upload-curriculum.swagger.ts @@ -1,21 +1,20 @@ -import { applyDecorators } from "@nestjs/common"; -import { ApiBody, ApiConsumes } from "@nestjs/swagger"; +import { applyDecorators } from '@nestjs/common'; +import { ApiBody, ApiConsumes } from '@nestjs/swagger'; export function UploadCurriculumSwagger() { - return applyDecorators( - ApiConsumes('multipart/form-data') , - ApiBody({ - description: 'Upload images', - schema: { - type: 'object', - properties: { - file: { - type: 'string', - format: 'binary', - }, - }, + return applyDecorators( + ApiConsumes('multipart/form-data'), + ApiBody({ + description: 'Upload images', + schema: { + type: 'object', + properties: { + file: { + type: 'string', + format: 'binary', }, - }) - ) - -} \ No newline at end of file + }, + }, + }), + ); +} diff --git a/src/shared/Swagger/decorators/jobs/archive-job.swagger.ts b/src/shared/Swagger/decorators/jobs/archive-job.swagger.ts index e8ad4ed..aae2f69 100644 --- a/src/shared/Swagger/decorators/jobs/archive-job.swagger.ts +++ b/src/shared/Swagger/decorators/jobs/archive-job.swagger.ts @@ -1,10 +1,10 @@ -import { applyDecorators } from "@nestjs/common"; -import { ApiOperation } from "@nestjs/swagger"; +import { applyDecorators } from '@nestjs/common'; +import { ApiOperation } from '@nestjs/swagger'; export function ArchiveJobSwagger() { - return applyDecorators( - ApiOperation({ - summary: 'Excluir uma vaga pelo id.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiOperation({ + summary: 'Excluir uma vaga pelo id.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/jobs/create-new-job.swagger.ts b/src/shared/Swagger/decorators/jobs/create-new-job.swagger.ts index 4935067..5b06762 100644 --- a/src/shared/Swagger/decorators/jobs/create-new-job.swagger.ts +++ b/src/shared/Swagger/decorators/jobs/create-new-job.swagger.ts @@ -1,30 +1,30 @@ -import { HttpStatus, applyDecorators } from "@nestjs/common"; -import { ApiOperation, ApiResponse } from "@nestjs/swagger"; -import { UnauthorizedSwagger } from "../../unauthorized.swagger"; -import { BadRequestSwagger } from "../../bad-request.swagger"; +import { HttpStatus, applyDecorators } from '@nestjs/common'; +import { ApiOperation, ApiResponse } from '@nestjs/swagger'; +import { UnauthorizedSwagger } from '../../unauthorized.swagger'; +import { BadRequestSwagger } from '../../bad-request.swagger'; export function CreateNewJobSwagger() { - return applyDecorators( - ApiResponse({ - status: HttpStatus.CREATED, - description: 'Exemplo do retorno de sucesso da rota', - type: 'Vaga publicada com sucesso', - }), - ApiResponse({ - status: HttpStatus.UNAUTHORIZED, - description: 'Modelo de erro', - type: UnauthorizedSwagger, - }), - ApiResponse({ - status: HttpStatus.BAD_REQUEST, - description: 'Modelo de erro', - type: BadRequestSwagger, - }), - ApiOperation({ - summary: 'Criar uma vaga!', - }), - ApiOperation({ - summary: 'Buscar todas as vagas.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiResponse({ + status: HttpStatus.CREATED, + description: 'Exemplo do retorno de sucesso da rota', + type: 'Vaga publicada com sucesso', + }), + ApiResponse({ + status: HttpStatus.UNAUTHORIZED, + description: 'Modelo de erro', + type: UnauthorizedSwagger, + }), + ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: 'Modelo de erro', + type: BadRequestSwagger, + }), + ApiOperation({ + summary: 'Criar uma vaga!', + }), + ApiOperation({ + summary: 'Buscar todas as vagas.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/jobs/get-all-jobs-of-logged-company.swagger copy.ts b/src/shared/Swagger/decorators/jobs/get-all-jobs-of-logged-company.swagger copy.ts index 0745a7a..9c95111 100644 --- a/src/shared/Swagger/decorators/jobs/get-all-jobs-of-logged-company.swagger copy.ts +++ b/src/shared/Swagger/decorators/jobs/get-all-jobs-of-logged-company.swagger copy.ts @@ -1,12 +1,12 @@ -import { HttpStatus, applyDecorators } from "@nestjs/common"; -import { ApiOperation, ApiResponse } from "@nestjs/swagger"; -import { UnauthorizedSwagger } from "../../unauthorized.swagger"; -import { BadRequestSwagger } from "../../bad-request.swagger"; +import { HttpStatus, applyDecorators } from '@nestjs/common'; +import { ApiOperation, ApiResponse } from '@nestjs/swagger'; +import { UnauthorizedSwagger } from '../../unauthorized.swagger'; +import { BadRequestSwagger } from '../../bad-request.swagger'; export function GetAllJobsSwagger() { - return applyDecorators( - ApiOperation({ - summary: 'Buscar todas as vagas.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiOperation({ + summary: 'Buscar todas as vagas.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/jobs/get-all-jobs-of-logged-company.swagger.ts b/src/shared/Swagger/decorators/jobs/get-all-jobs-of-logged-company.swagger.ts index d6afff1..4e3325f 100644 --- a/src/shared/Swagger/decorators/jobs/get-all-jobs-of-logged-company.swagger.ts +++ b/src/shared/Swagger/decorators/jobs/get-all-jobs-of-logged-company.swagger.ts @@ -1,12 +1,12 @@ -import { HttpStatus, applyDecorators } from "@nestjs/common"; -import { ApiOperation, ApiResponse } from "@nestjs/swagger"; -import { UnauthorizedSwagger } from "../../unauthorized.swagger"; -import { BadRequestSwagger } from "../../bad-request.swagger"; +import { HttpStatus, applyDecorators } from '@nestjs/common'; +import { ApiOperation, ApiResponse } from '@nestjs/swagger'; +import { UnauthorizedSwagger } from '../../unauthorized.swagger'; +import { BadRequestSwagger } from '../../bad-request.swagger'; export function GetAllJobsOfLoggedCompanySwagger() { - return applyDecorators( - ApiOperation({ - summary: 'Buscar todas as vagas da empresa logada.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiOperation({ + summary: 'Buscar todas as vagas da empresa logada.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/jobs/get-one-job.swagger.ts b/src/shared/Swagger/decorators/jobs/get-one-job.swagger.ts index 87c6524..07acffd 100644 --- a/src/shared/Swagger/decorators/jobs/get-one-job.swagger.ts +++ b/src/shared/Swagger/decorators/jobs/get-one-job.swagger.ts @@ -1,10 +1,10 @@ -import { applyDecorators } from "@nestjs/common"; -import { ApiOperation } from "@nestjs/swagger"; +import { applyDecorators } from '@nestjs/common'; +import { ApiOperation } from '@nestjs/swagger'; export function GetOneJobSwagger() { - return applyDecorators( - ApiOperation({ - summary: 'Buscar uma vaga pelo id.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiOperation({ + summary: 'Buscar uma vaga pelo id.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/jobs/search-job.swagger.ts b/src/shared/Swagger/decorators/jobs/search-job.swagger.ts index 2eaaa30..ecb645b 100644 --- a/src/shared/Swagger/decorators/jobs/search-job.swagger.ts +++ b/src/shared/Swagger/decorators/jobs/search-job.swagger.ts @@ -1,10 +1,10 @@ -import { applyDecorators } from "@nestjs/common"; -import { ApiOperation } from "@nestjs/swagger"; +import { applyDecorators } from '@nestjs/common'; +import { ApiOperation } from '@nestjs/swagger'; -export function SearchJobSwagger(){ - return applyDecorators( - ApiOperation({ - summary: 'Buscar vaga', - }) - ) -} \ No newline at end of file +export function SearchJobSwagger() { + return applyDecorators( + ApiOperation({ + summary: 'Buscar vaga', + }), + ); +} diff --git a/src/shared/Swagger/decorators/jobs/update-job.swagger.ts b/src/shared/Swagger/decorators/jobs/update-job.swagger.ts index f4be1fb..ac53177 100644 --- a/src/shared/Swagger/decorators/jobs/update-job.swagger.ts +++ b/src/shared/Swagger/decorators/jobs/update-job.swagger.ts @@ -1,10 +1,10 @@ -import { applyDecorators } from "@nestjs/common"; -import { ApiOperation } from "@nestjs/swagger"; +import { applyDecorators } from '@nestjs/common'; +import { ApiOperation } from '@nestjs/swagger'; export function UpdateJobSwagger() { - return applyDecorators( - ApiOperation({ - summary: 'Atualizar uma vaga pelo id.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiOperation({ + summary: 'Atualizar uma vaga pelo id.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/reports/create-report.swagger.ts b/src/shared/Swagger/decorators/reports/create-report.swagger.ts index 78c3886..a017d17 100644 --- a/src/shared/Swagger/decorators/reports/create-report.swagger.ts +++ b/src/shared/Swagger/decorators/reports/create-report.swagger.ts @@ -1,10 +1,10 @@ -import { applyDecorators } from "@nestjs/common"; -import { ApiOperation } from "@nestjs/swagger"; +import { applyDecorators } from '@nestjs/common'; +import { ApiOperation } from '@nestjs/swagger'; export function CreateReportSwagger() { - return applyDecorators( - ApiOperation({ - summary: 'Criar um relatório.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiOperation({ + summary: 'Criar um relatório.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/reports/delete-report.swagger.ts b/src/shared/Swagger/decorators/reports/delete-report.swagger.ts index 9e75f41..7ed403d 100644 --- a/src/shared/Swagger/decorators/reports/delete-report.swagger.ts +++ b/src/shared/Swagger/decorators/reports/delete-report.swagger.ts @@ -1,10 +1,10 @@ -import { applyDecorators } from "@nestjs/common"; -import { ApiOperation } from "@nestjs/swagger"; +import { applyDecorators } from '@nestjs/common'; +import { ApiOperation } from '@nestjs/swagger'; export function DeleteReportSwagger() { - return applyDecorators( - ApiOperation({ - summary: 'Excluir um relatório por id.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiOperation({ + summary: 'Excluir um relatório por id.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/reports/get-all-reports.swagger.ts b/src/shared/Swagger/decorators/reports/get-all-reports.swagger.ts index d2c6e23..dba81af 100644 --- a/src/shared/Swagger/decorators/reports/get-all-reports.swagger.ts +++ b/src/shared/Swagger/decorators/reports/get-all-reports.swagger.ts @@ -1,10 +1,10 @@ -import { applyDecorators } from "@nestjs/common"; -import { ApiOperation } from "@nestjs/swagger"; +import { applyDecorators } from '@nestjs/common'; +import { ApiOperation } from '@nestjs/swagger'; export function GetAllReportsSwagger() { - return applyDecorators( - ApiOperation({ - summary: 'Encontrar todos os relatórios.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiOperation({ + summary: 'Encontrar todos os relatórios.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/reports/get-report-by-id.swagger.ts b/src/shared/Swagger/decorators/reports/get-report-by-id.swagger.ts index da89c51..f846ad7 100644 --- a/src/shared/Swagger/decorators/reports/get-report-by-id.swagger.ts +++ b/src/shared/Swagger/decorators/reports/get-report-by-id.swagger.ts @@ -1,10 +1,10 @@ -import { applyDecorators } from "@nestjs/common"; -import { ApiOperation } from "@nestjs/swagger"; +import { applyDecorators } from '@nestjs/common'; +import { ApiOperation } from '@nestjs/swagger'; export function GetReportByIdSwagger() { - return applyDecorators( - ApiOperation({ - summary: 'Encontrar um relatório por id.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiOperation({ + summary: 'Encontrar um relatório por id.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/reports/update-report.swagger.ts b/src/shared/Swagger/decorators/reports/update-report.swagger.ts index 2575bfd..1132c04 100644 --- a/src/shared/Swagger/decorators/reports/update-report.swagger.ts +++ b/src/shared/Swagger/decorators/reports/update-report.swagger.ts @@ -1,10 +1,10 @@ -import { applyDecorators } from "@nestjs/common"; -import { ApiOperation } from "@nestjs/swagger"; +import { applyDecorators } from '@nestjs/common'; +import { ApiOperation } from '@nestjs/swagger'; export function UpdateReportSwagger() { - return applyDecorators( - ApiOperation({ - summary: 'Atualizar um relatório por id.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiOperation({ + summary: 'Atualizar um relatório por id.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/upload/upload.swagger.ts b/src/shared/Swagger/decorators/upload/upload.swagger.ts index a318d67..a790f34 100644 --- a/src/shared/Swagger/decorators/upload/upload.swagger.ts +++ b/src/shared/Swagger/decorators/upload/upload.swagger.ts @@ -1,22 +1,21 @@ -import { applyDecorators } from "@nestjs/common"; -import { ApiBody, ApiConsumes, ApiProperty } from "@nestjs/swagger"; +import { applyDecorators } from '@nestjs/common'; +import { ApiBody, ApiConsumes, ApiProperty } from '@nestjs/swagger'; export function UploadSwagger() { - return applyDecorators( - ApiProperty(), - ApiConsumes('multipart/form-data'), - ApiBody({ - description: 'Upload images', - schema: { - type: 'object', - properties: { - file: { - type: 'string', - format: 'binary', - }, + return applyDecorators( + ApiProperty(), + ApiConsumes('multipart/form-data'), + ApiBody({ + description: 'Upload images', + schema: { + type: 'object', + properties: { + file: { + type: 'string', + format: 'binary', }, - } - }) - ) - -} \ No newline at end of file + }, + }, + }), + ); +} diff --git a/src/shared/Swagger/decorators/user/classes/create-response.swagger.ts b/src/shared/Swagger/decorators/user/classes/create-response.swagger.ts index 41ae5bd..0912eac 100644 --- a/src/shared/Swagger/decorators/user/classes/create-response.swagger.ts +++ b/src/shared/Swagger/decorators/user/classes/create-response.swagger.ts @@ -42,4 +42,4 @@ export class CreateResponseSwagger { example: false, }) mailConfirm: boolean; -} \ No newline at end of file +} diff --git a/src/shared/Swagger/decorators/user/classes/list-response.swagger.ts b/src/shared/Swagger/decorators/user/classes/list-response.swagger.ts index 01bae1f..19a87a9 100644 --- a/src/shared/Swagger/decorators/user/classes/list-response.swagger.ts +++ b/src/shared/Swagger/decorators/user/classes/list-response.swagger.ts @@ -71,4 +71,4 @@ export class ListResponseSwagger { type: MetaPaginationSwagger, }) meta: MetaPaginationSwagger; -} \ No newline at end of file +} diff --git a/src/shared/Swagger/decorators/user/classes/recovery-password.swagger.ts b/src/shared/Swagger/decorators/user/classes/recovery-password.swagger.ts index ccc019f..41416bf 100644 --- a/src/shared/Swagger/decorators/user/classes/recovery-password.swagger.ts +++ b/src/shared/Swagger/decorators/user/classes/recovery-password.swagger.ts @@ -6,4 +6,4 @@ export class RecoveryPasswordSwagger { 'Caso esse e-mail esteja cadastrado no sistema, será encaminhado para ele uma mensagem de orientação sobre os próximos passos para a redefinição da senha.', }) message: string; -} \ No newline at end of file +} diff --git a/src/shared/Swagger/decorators/user/delete-user.swagger.decorator.ts b/src/shared/Swagger/decorators/user/delete-user.swagger.decorator.ts index 10d1091..68b6937 100644 --- a/src/shared/Swagger/decorators/user/delete-user.swagger.decorator.ts +++ b/src/shared/Swagger/decorators/user/delete-user.swagger.decorator.ts @@ -6,28 +6,28 @@ import { NotFoundSwagger } from '../../not-found.swagger'; import { UnauthorizedSwagger } from '../../unauthorized.swagger'; export function SwaggerDeleteUser() { - return applyDecorators( - ApiResponse({ - status: HttpStatus.OK, - description: 'Exemplo do retorno de sucesso da rota', - type: NotFoundSwagger, - }), - ApiResponse({ - status: HttpStatus.UNAUTHORIZED, - description: 'Modelo de erro', - type: UnauthorizedSwagger, - }), - ApiResponse({ - status: HttpStatus.BAD_REQUEST, - description: 'Modelo de erro', - type: BadRequestSwagger, - }), - ApiOperation({ - summary: 'Deletar um usuário pelo ID', - }), - ApiParam({ - type: GetByParamsDto, - name: '', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiResponse({ + status: HttpStatus.OK, + description: 'Exemplo do retorno de sucesso da rota', + type: NotFoundSwagger, + }), + ApiResponse({ + status: HttpStatus.UNAUTHORIZED, + description: 'Modelo de erro', + type: UnauthorizedSwagger, + }), + ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: 'Modelo de erro', + type: BadRequestSwagger, + }), + ApiOperation({ + summary: 'Deletar um usuário pelo ID', + }), + ApiParam({ + type: GetByParamsDto, + name: '', + }), + ); +} diff --git a/src/shared/Swagger/decorators/user/get-user-adm.swagger.decorator.ts b/src/shared/Swagger/decorators/user/get-user-adm.swagger.decorator.ts index 6acca22..c941704 100644 --- a/src/shared/Swagger/decorators/user/get-user-adm.swagger.decorator.ts +++ b/src/shared/Swagger/decorators/user/get-user-adm.swagger.decorator.ts @@ -5,7 +5,6 @@ import { BadRequestSwagger } from '../../bad-request.swagger'; import { UnauthorizedSwagger } from '../../unauthorized.swagger'; import { CreateResponseSwagger } from './classes/create-response.swagger'; - export function SwaggerGetUserAdm() { return applyDecorators( ApiResponse({ @@ -29,6 +28,6 @@ export function SwaggerGetUserAdm() { ApiParam({ type: GetByParamsDto, name: '', - }) + }), ); } diff --git a/src/shared/Swagger/decorators/user/get-user.swagger.decorator.ts b/src/shared/Swagger/decorators/user/get-user.swagger.decorator.ts index 8d3e89b..64242ce 100644 --- a/src/shared/Swagger/decorators/user/get-user.swagger.decorator.ts +++ b/src/shared/Swagger/decorators/user/get-user.swagger.decorator.ts @@ -4,8 +4,6 @@ import { BadRequestSwagger } from '../../bad-request.swagger'; import { UnprocessableEntitySwagger } from '../../unprocessable-entity.swagger'; import { CreateResponseSwagger } from './classes/create-response.swagger'; - - export function SwaggerGetUser() { return applyDecorators( ApiResponse({ @@ -25,6 +23,6 @@ export function SwaggerGetUser() { }), ApiOperation({ summary: 'Ativar um usuário pelo ID', - }) + }), ); } diff --git a/src/shared/Swagger/decorators/user/recover-by-email.swagger.decorator.ts b/src/shared/Swagger/decorators/user/recover-by-email.swagger.decorator.ts index 522fd91..7314d9f 100644 --- a/src/shared/Swagger/decorators/user/recover-by-email.swagger.decorator.ts +++ b/src/shared/Swagger/decorators/user/recover-by-email.swagger.decorator.ts @@ -4,26 +4,25 @@ import { BadRequestSwagger } from '../../bad-request.swagger'; import { UnauthorizedSwagger } from '../../unauthorized.swagger'; import { RecoveryPasswordSwagger } from './classes/recovery-password.swagger'; - export function SwaggerRecoverEmail() { - return applyDecorators( - ApiResponse({ - status: HttpStatus.OK, - description: 'Exemplo do retorno de sucesso da rota', - type: RecoveryPasswordSwagger, - }), - ApiResponse({ - status: HttpStatus.UNAUTHORIZED, - description: 'Modelo de erro', - type: UnauthorizedSwagger, - }), - ApiResponse({ - status: HttpStatus.BAD_REQUEST, - description: 'Modelo de erro', - type: BadRequestSwagger, - }), - ApiOperation({ - summary: 'Send email to recovery password.', - }), - ) -} \ No newline at end of file + return applyDecorators( + ApiResponse({ + status: HttpStatus.OK, + description: 'Exemplo do retorno de sucesso da rota', + type: RecoveryPasswordSwagger, + }), + ApiResponse({ + status: HttpStatus.UNAUTHORIZED, + description: 'Modelo de erro', + type: UnauthorizedSwagger, + }), + ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: 'Modelo de erro', + type: BadRequestSwagger, + }), + ApiOperation({ + summary: 'Send email to recovery password.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/user/update-pass-after-email-recovery.swagger.decorator.ts b/src/shared/Swagger/decorators/user/update-pass-after-email-recovery.swagger.decorator.ts index 4ad0a49..07e2a51 100644 --- a/src/shared/Swagger/decorators/user/update-pass-after-email-recovery.swagger.decorator.ts +++ b/src/shared/Swagger/decorators/user/update-pass-after-email-recovery.swagger.decorator.ts @@ -5,24 +5,24 @@ import { NotFoundSwagger } from '../../not-found.swagger'; import { UnauthorizedSwagger } from '../../unauthorized.swagger'; export function SwaggerUpdatePassAfterRecovery() { - return applyDecorators( - ApiResponse({ - status: HttpStatus.OK, - description: 'Exemplo do retorno de sucesso da rota', - type: NotFoundSwagger, - }), - ApiResponse({ - status: HttpStatus.UNAUTHORIZED, - description: 'Modelo de erro', - type: UnauthorizedSwagger, - }), - ApiResponse({ - status: HttpStatus.BAD_REQUEST, - description: 'Modelo de erro', - type: BadRequestSwagger, - }), - ApiOperation({ - summary: 'User update password.', - }), - ) -} \ No newline at end of file + return applyDecorators( + ApiResponse({ + status: HttpStatus.OK, + description: 'Exemplo do retorno de sucesso da rota', + type: NotFoundSwagger, + }), + ApiResponse({ + status: HttpStatus.UNAUTHORIZED, + description: 'Modelo de erro', + type: UnauthorizedSwagger, + }), + ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: 'Modelo de erro', + type: BadRequestSwagger, + }), + ApiOperation({ + summary: 'User update password.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/user/update-password.swagger.decorator.ts b/src/shared/Swagger/decorators/user/update-password.swagger.decorator.ts index 0dfc189..0252f0d 100644 --- a/src/shared/Swagger/decorators/user/update-password.swagger.decorator.ts +++ b/src/shared/Swagger/decorators/user/update-password.swagger.decorator.ts @@ -5,24 +5,24 @@ import { NotFoundSwagger } from '../../not-found.swagger'; import { UnauthorizedSwagger } from '../../unauthorized.swagger'; export function SwaggerUpdatePassword() { - return applyDecorators( - ApiResponse({ - status: HttpStatus.OK, - description: 'Exemplo do retorno de sucesso da rota', - type: NotFoundSwagger, - }), - ApiResponse({ - status: HttpStatus.UNAUTHORIZED, - description: 'Modelo de erro', - type: UnauthorizedSwagger, - }), - ApiResponse({ - status: HttpStatus.BAD_REQUEST, - description: 'Modelo de erro', - type: BadRequestSwagger, - }), - ApiOperation({ - summary: 'User update password without recovery e-mail.', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiResponse({ + status: HttpStatus.OK, + description: 'Exemplo do retorno de sucesso da rota', + type: NotFoundSwagger, + }), + ApiResponse({ + status: HttpStatus.UNAUTHORIZED, + description: 'Modelo de erro', + type: UnauthorizedSwagger, + }), + ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: 'Modelo de erro', + type: BadRequestSwagger, + }), + ApiOperation({ + summary: 'User update password without recovery e-mail.', + }), + ); +} diff --git a/src/shared/Swagger/decorators/user/update-user.swagger.decorator.ts b/src/shared/Swagger/decorators/user/update-user.swagger.decorator.ts index 809103f..3964a79 100644 --- a/src/shared/Swagger/decorators/user/update-user.swagger.decorator.ts +++ b/src/shared/Swagger/decorators/user/update-user.swagger.decorator.ts @@ -1,39 +1,39 @@ -import { applyDecorators, HttpStatus } from "@nestjs/common" +import { applyDecorators, HttpStatus } from '@nestjs/common'; import { ApiOperation, ApiResponse, ApiBody } from '@nestjs/swagger'; -import { BadRequestSwagger } from "../../bad-request.swagger"; -import { UnauthorizedSwagger } from "../../unauthorized.swagger"; +import { BadRequestSwagger } from '../../bad-request.swagger'; +import { UnauthorizedSwagger } from '../../unauthorized.swagger'; export function SwaggerUpdateUser() { - return applyDecorators( - ApiBody({ - description: 'Upload images', - schema: { - type: 'object', - properties: { - file: { - type: 'string', - format: 'binary', - }, - }, - }, - }), - ApiResponse({ - status: HttpStatus.OK, - description: 'Exemplo do retorno de sucesso da rota', - type: BadRequestSwagger, - }), - ApiResponse({ - status: HttpStatus.UNAUTHORIZED, - description: 'Modelo de erro', - type: UnauthorizedSwagger, - }), - ApiResponse({ - status: HttpStatus.BAD_REQUEST, - description: 'Modelo de erro', - type: BadRequestSwagger, - }), - ApiOperation({ - summary: 'Atualizar um usuário pelo ID', - }) - ) -} \ No newline at end of file + return applyDecorators( + ApiBody({ + description: 'Upload images', + schema: { + type: 'object', + properties: { + file: { + type: 'string', + format: 'binary', + }, + }, + }, + }), + ApiResponse({ + status: HttpStatus.OK, + description: 'Exemplo do retorno de sucesso da rota', + type: BadRequestSwagger, + }), + ApiResponse({ + status: HttpStatus.UNAUTHORIZED, + description: 'Modelo de erro', + type: UnauthorizedSwagger, + }), + ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: 'Modelo de erro', + type: BadRequestSwagger, + }), + ApiOperation({ + summary: 'Atualizar um usuário pelo ID', + }), + ); +} diff --git a/src/shared/Swagger/decorators/user/view-users.swagger.decorator.ts b/src/shared/Swagger/decorators/user/view-users.swagger.decorator.ts index 34b5c6c..dca20ec 100644 --- a/src/shared/Swagger/decorators/user/view-users.swagger.decorator.ts +++ b/src/shared/Swagger/decorators/user/view-users.swagger.decorator.ts @@ -4,26 +4,25 @@ import { BadRequestSwagger } from '../../bad-request.swagger'; import { UnauthorizedSwagger } from '../../unauthorized.swagger'; import { ListResponseSwagger } from './classes/list-response.swagger'; - export function SwaggerFindUsers() { - return applyDecorators( -ApiResponse({ - status: HttpStatus.OK, - description: 'Exemplo do retorno de sucesso da rota', - type: ListResponseSwagger, - }), - ApiResponse({ - status: HttpStatus.UNAUTHORIZED, - description: 'Modelo de erro', - type: UnauthorizedSwagger, - }), - ApiResponse({ - status: HttpStatus.BAD_REQUEST, - description: 'Modelo de erro', - type: BadRequestSwagger, - }), - ApiOperation({ - summary: 'Visualizar todos os usuários', - }), - ) -} \ No newline at end of file + return applyDecorators( + ApiResponse({ + status: HttpStatus.OK, + description: 'Exemplo do retorno de sucesso da rota', + type: ListResponseSwagger, + }), + ApiResponse({ + status: HttpStatus.UNAUTHORIZED, + description: 'Modelo de erro', + type: UnauthorizedSwagger, + }), + ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: 'Modelo de erro', + type: BadRequestSwagger, + }), + ApiOperation({ + summary: 'Visualizar todos os usuários', + }), + ); +} From 8803086d590269756176397f573dae7ad352934c Mon Sep 17 00:00:00 2001 From: Wanderson Santos <81826043+wandersonDeve@users.noreply.github.com> Date: Sun, 1 Oct 2023 11:56:13 -0300 Subject: [PATCH 2/3] refactor: remome useless import --- src/modules/applications/applications.controller.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/applications/applications.controller.ts b/src/modules/applications/applications.controller.ts index 84f6f26..f08ff04 100644 --- a/src/modules/applications/applications.controller.ts +++ b/src/modules/applications/applications.controller.ts @@ -5,9 +5,8 @@ import { CurriculumEntity } from '../../database/entities/curriculum.entity'; import { JobsEntity } from '../../database/entities/jobs.entity'; import { UsersEntity } from '../../database/entities/users.entity'; import GetEntity from '../../shared/pipes/pipe-entity.pipe'; -import { LoggedAdmin } from '../auth/decorator/logged-admin.decorator'; -import { ApplicationsService } from './applications.service'; import { LoggedUser } from '../auth/decorator/logged-user.decorator'; +import { ApplicationsService } from './applications.service'; @ApiTags('Applications') @ApiBearerAuth() From 0da75b7f1320b3c6d7f5c015d286f47a1fcd8cae Mon Sep 17 00:00:00 2001 From: Wanderson Santos <81826043+wandersonDeve@users.noreply.github.com> Date: Sun, 1 Oct 2023 12:00:45 -0300 Subject: [PATCH 3/3] feat: set catch in db calls --- .../applications/repository/applications.repository.ts | 3 ++- src/modules/company/repository/company-repository.ts | 4 ++-- src/modules/jobs/repository/job.repository.ts | 2 +- src/modules/user/repository/user.repository.ts | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/modules/applications/repository/applications.repository.ts b/src/modules/applications/repository/applications.repository.ts index 4705623..3072dfc 100644 --- a/src/modules/applications/repository/applications.repository.ts +++ b/src/modules/applications/repository/applications.repository.ts @@ -1,9 +1,10 @@ import { EntityRepository, Repository } from 'typeorm'; import { ApplicationEntity } from '../../../database/entities/applications.entity'; +import { handleError } from '../../../shared/utils/handle-error.util'; @EntityRepository(ApplicationEntity) export class ApplicationsRepository extends Repository { async saveApplication(data: any): Promise { - return this.save(data); + return this.save(data).catch(handleError); } } diff --git a/src/modules/company/repository/company-repository.ts b/src/modules/company/repository/company-repository.ts index 156bf02..45990b4 100644 --- a/src/modules/company/repository/company-repository.ts +++ b/src/modules/company/repository/company-repository.ts @@ -10,7 +10,7 @@ import { UpdateMyPasswordDto } from '../dtos/update-my-password.dto'; export class CompanyRepository extends Repository { async createCompany(data: CreateCompanyDto): Promise { delete data.passwordConfirmation; - return this.save(data); + return this.save(data).catch(handleError); } async findAllCompany( @@ -89,7 +89,7 @@ export class CompanyRepository extends Repository { company.recoverPasswordToken = recoverPasswordToken; - await this.save(company); + await this.save(company).catch(handleError); return company; } diff --git a/src/modules/jobs/repository/job.repository.ts b/src/modules/jobs/repository/job.repository.ts index 4ef7d34..cd093cc 100644 --- a/src/modules/jobs/repository/job.repository.ts +++ b/src/modules/jobs/repository/job.repository.ts @@ -75,7 +75,7 @@ export class JobRepository extends Repository { ]) .where('jobs.id = :id', { id }); - return queryBuilder.getOne(); + return queryBuilder.getOne().catch(handleError); } async updateJob(id: string, data: UpdateJobDto) { diff --git a/src/modules/user/repository/user.repository.ts b/src/modules/user/repository/user.repository.ts index 3c2692f..898a81f 100644 --- a/src/modules/user/repository/user.repository.ts +++ b/src/modules/user/repository/user.repository.ts @@ -98,7 +98,7 @@ export class UserRepository extends Repository { user.mailConfirm = true; - await this.update(id, { mailConfirm: true }); + await this.update(id, { mailConfirm: true }).catch(handleError); return this.findOne(id); }