Skip to content

Create User try catch on the service layer. #676

@EMazzaglia

Description

@EMazzaglia
  @Post()
  async post(@Body() userDTO: SignUpDTO): Promise<InsertResult> {
    try {
      return await this.usersService.createUser(
        EntityMapper.mapTo(User, userDTO)
      );
    } catch (error: any) {
      throw new BadRequestError(
        error.detail ?? error.message ?? ErrorsMessages.INTERNAL_SERVER_ERROR
      );
    }
  }
  

This shouldnt have the try catch and delegate the responsability to the service.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions