diff --git a/back/volume/src/users/users.controller.ts b/back/volume/src/users/users.controller.ts index f848880..9249c87 100644 --- a/back/volume/src/users/users.controller.ts +++ b/back/volume/src/users/users.controller.ts @@ -38,6 +38,16 @@ export class UsersController { return await this.usersService.findUsers() } + @Get('online') + async getOnlineUsers (): Promise { + return await this.usersService.findOnlineUsers() + } + + @Get(':id') + async getUser (@Param('id', ParseIntPipe) ftId: number): Promise { + return await this.usersService.findUser(ftId) + } + @Post() @UseGuards(AuthenticatedGuard) async create (@Body() payload: UserDto, @FtUser() profile: Profile) { diff --git a/back/volume/src/users/users.service.ts b/back/volume/src/users/users.service.ts index 694ea3b..a538bee 100644 --- a/back/volume/src/users/users.service.ts +++ b/back/volume/src/users/users.service.ts @@ -75,7 +75,7 @@ export class UsersService { async invit (ftId: number, targetFtId: number) { const user = await this.findUser(ftId) const target = await this.findUser(targetFtId) - if (!target) { + if (target == null) { return new NotFoundException( `Error: user id ${targetFtId} isn't in our db.` ) diff --git a/back/volume/tsconfig.json b/back/volume/tsconfig.json index bdbebe4..35e1f74 100644 --- a/back/volume/tsconfig.json +++ b/back/volume/tsconfig.json @@ -13,6 +13,7 @@ "incremental": true, "skipLibCheck": true, "alwaysStrict": true, - "noImplicitAny": true + "noImplicitAny": true, + "strictNullChecks": true } }