Commit 1646205c authored by Diego Iván's avatar Diego Iván
Browse files

agregando docs para todos los endpoints

parent d1764a47
Loading
Loading
Loading
Loading
+10 −12
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ import {
import { AuthUserService } from './authUserservice';
import { CreateUserDto } from 'src/user/dto/create-user.dto';
import { LoginUserDto } from './dto/login-user.dto';
import { UserSigninResDto } from './dto/user-signin-res.dto';

@Controller('')
@ApiTags('Create user account and sign in as user')
@@ -18,31 +19,28 @@ export class AuthUserController {
  @ApiBody({ type: CreateUserDto })
  @ApiBearerAuth()
  @ApiCreatedResponse({
    content: {
      'application/json': {
        example: {
          token: 'token',
        },
      },
    },
    type: UserSigninResDto,
  })
  @Post('user/signup')
  async signUp(@Body() createAdminDto: CreateUserDto) {
    try {
      const accessToken = await this.authUserService.signUp(createAdminDto);
      return { token: accessToken };
      const adminSigninResDto =
        await this.authUserService.signUp(createAdminDto);
      return { user: adminSigninResDto };
    } catch (e) {
      throw e;
    }
  }
  @ApiBody({ type: LoginUserDto })
  @ApiCreatedResponse({
    type: UserSigninResDto,
  })
  @ApiUnauthorizedResponse()
  @Post('user/signin')
  async signIn(@Body() loginAdminDto: LoginUserDto) {
    try {
      const adminSigninResDto =
        await this.authUserService.signIn(loginAdminDto);
      return adminSigninResDto;
      const userSigninResDto = await this.authUserService.signIn(loginAdminDto);
      return { user: userSigninResDto };
    } catch (e) {
      throw e;
    }