Skip to content
Snippets Groups Projects
Select Git revision
  • 1ea6a2a4ea61a67b2244c827246bf907c4dc638d
  • master default protected
  • improved-skeleton
  • xsrf-token
4 results

sass-recommendation.md

Blame
  • temp-user.controller.ts 687 B
    import { Controller, Get, HttpException, HttpStatus, Param } from '@nestjs/common';
    import { ApiParam } from '@nestjs/swagger';
    import { TempUser } from './temp-user.schema';
    import { TempUserService } from './temp-user.service';
    
    @Controller('temp-user')
    export class TempUserController {
      constructor(private readonly tempUserSercice: TempUserService) {}
    
      @Get(':id')
      @ApiParam({ name: 'id', type: String, required: true })
      public async getTempUser(@Param('id') id: string): Promise<TempUser> {
        const user = await this.tempUserSercice.findById(id);
        if (!user) {
          throw new HttpException('User does not exists', HttpStatus.BAD_REQUEST);
        }
        return user;
      }
    }