Skip to content
Snippets Groups Projects
Select Git revision
  • ca55e326be4138bdaaf3e1231d0b2cdfe0f6a5f0
  • dev default protected
  • renovate/cozy-realtime-5.x
  • renovate/devdependencies-(non-major)
  • renovate/copy-webpack-plugin-13.x
  • renovate/major-react-monorepo
  • renovate/couchdb-3.x
  • renovate/cozy-device-helper-3.x
  • renovate/cozy-flags-4.x
  • renovate/eslint-config-prettier-10.x
  • renovate/major-react-router-monorepo
  • renovate/major-typescript-eslint-monorepo
  • renovate/sass-loader-16.x
  • renovate/eslint-plugin-testing-library-7.x
  • renovate/cozy-scripts-8.x
  • renovate/cozy-harvest-lib-9.x
  • renovate/cozy-client-49.x
  • build-test protected
  • build-dev protected
  • lint/testing-libraby-plugin
  • build protected
  • v3.1.1
  • v3.1.0
  • v3.0.0
  • v2.8.0
  • v2.7.2
  • v2.7.1
  • v2.7.0
  • v2.6.0
  • v2.5.1
  • v2.5.0
  • v2.4.0
  • v2.3.1
  • v2.3.0
  • v2.2.2
  • v2.2.1
  • v2.2.0
  • v2.1.1
  • v2.1.0
  • v2.0.2
  • v2.0.1
41 results

challenge.service.ts

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;
      }
    }