Skip to content
Snippets Groups Projects
Commit 438026fa authored by ALGLAVE Ivan's avatar ALGLAVE Ivan
Browse files

ESLint compliance

parent 0da7bb63
No related branches found
No related tags found
No related merge requests found
...@@ -12,29 +12,21 @@ import { ...@@ -12,29 +12,21 @@ import {
import { CreatePeopleDto } from './dto/create-people.dto'; import { CreatePeopleDto } from './dto/create-people.dto';
import { UpdatePeopleDto } from './dto/update-people.dto'; import { UpdatePeopleDto } from './dto/update-people.dto';
import { HttpInterceptor } from '../interceptors/http.interceptor'; import { HttpInterceptor } from '../interceptors/http.interceptor';
// import { CreatePeopleDto } from './dto/create-people.dto';
// import { UpdatePeopleDto } from './dto/update-people.dto';
import { PeopleEntity } from './entities/people.entity'; import { PeopleEntity } from './entities/people.entity';
import { PeopleService } from './people.service'; import { PeopleService } from './people.service';
import { AuthGuard } from '@nestjs/passport'; import { AuthGuard } from '@nestjs/passport';
interface Login {
email: string;
password: string;
}
@Controller('people') @Controller('people')
@UseInterceptors(HttpInterceptor) @UseInterceptors(HttpInterceptor)
export class PeopleController { export class PeopleController {
constructor(private readonly _peopleService: PeopleService) {} constructor(private readonly _peopleService: PeopleService) {}
//@UseGuards(AuthGuard('jwt')) //@UseGuards(AuthGuard('jwt'))
@Get() @Get()
findAll(): Promise<PeopleEntity[] | void> { findAll(): Promise<PeopleEntity[] | void> {
return this._peopleService.findAll(); return this._peopleService.findAll();
} }
@UseGuards(AuthGuard('jwt')) @UseGuards(AuthGuard('jwt'))
@Get(':id') @Get(':id')
findOne(@Param() params: { id: string }): Promise<PeopleEntity | void> { findOne(@Param() params: { id: string }): Promise<PeopleEntity | void> {
......
...@@ -4,13 +4,9 @@ import { CreatePeopleDto } from './dto/create-people.dto'; ...@@ -4,13 +4,9 @@ import { CreatePeopleDto } from './dto/create-people.dto';
import { UpdatePeopleDto } from './dto/update-people.dto'; import { UpdatePeopleDto } from './dto/update-people.dto';
import { PeopleEntity } from './entities/people.entity'; import { PeopleEntity } from './entities/people.entity';
@Injectable() @Injectable()
export class PeopleService { export class PeopleService {
constructor(private readonly _peopleDao: PeopleDao) {}
constructor(
private readonly _peopleDao: PeopleDao,
) {}
login = (email: string, password: string): Promise<PeopleEntity | void> => login = (email: string, password: string): Promise<PeopleEntity | void> =>
this._peopleDao.login(email, password); this._peopleDao.login(email, password);
...@@ -20,9 +16,8 @@ export class PeopleService { ...@@ -20,9 +16,8 @@ export class PeopleService {
findOne = (id: string): Promise<PeopleEntity | void> => findOne = (id: string): Promise<PeopleEntity | void> =>
this._peopleDao.findById(id); this._peopleDao.findById(id);
create (people: CreatePeopleDto): Promise<PeopleEntity> { create = (people: CreatePeopleDto): Promise<PeopleEntity> =>
return this._peopleDao.save(people); this._peopleDao.save(people);
}
createMany = (people: CreatePeopleDto[]): Promise<PeopleEntity[]> => { createMany = (people: CreatePeopleDto[]): Promise<PeopleEntity[]> => {
return this._peopleDao.saveMany(people); return this._peopleDao.saveMany(people);
...@@ -36,5 +31,4 @@ export class PeopleService { ...@@ -36,5 +31,4 @@ export class PeopleService {
delete = (id: string): Promise<PeopleEntity | void> => delete = (id: string): Promise<PeopleEntity | void> =>
this._peopleDao.findByIdAndRemove(id); this._peopleDao.findByIdAndRemove(id);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment