Browse Source

* Added tsconfig rule

master
vvandenb 2 years ago
committed by nicolas-arnaud
parent
commit
39d3dec363
  1. 10
      back/volume/src/users/users.controller.ts
  2. 2
      back/volume/src/users/users.service.ts
  3. 3
      back/volume/tsconfig.json

10
back/volume/src/users/users.controller.ts

@ -38,6 +38,16 @@ export class UsersController {
return await this.usersService.findUsers()
}
@Get('online')
async getOnlineUsers (): Promise<User[]> {
return await this.usersService.findOnlineUsers()
}
@Get(':id')
async getUser (@Param('id', ParseIntPipe) ftId: number): Promise<User> {
return await this.usersService.findUser(ftId)
}
@Post()
@UseGuards(AuthenticatedGuard)
async create (@Body() payload: UserDto, @FtUser() profile: Profile) {

2
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.`
)

3
back/volume/tsconfig.json

@ -13,6 +13,7 @@
"incremental": true,
"skipLibCheck": true,
"alwaysStrict": true,
"noImplicitAny": true
"noImplicitAny": true,
"strictNullChecks": true
}
}

Loading…
Cancel
Save