Skip to content

Commit

Permalink
[#15] refat - Rename create to createPoint
Browse files Browse the repository at this point in the history
Co-authored-by: Leonardo Barreiros <leossb36@gmail.com>
  • Loading branch information
guilherme1guy and leossb36 committed Sep 28, 2021
1 parent 6b060b9 commit c09bc68
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/mapas/mapas.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export class MapasController {
constructor(private readonly mapasService: MapasService) {}

@MessagePattern('createPoint')
async create(@Payload() createPointDto: CreatePointDto) {
const id = await this.mapasService.create(createPointDto);
async createPoint(@Payload() createPointDto: CreatePointDto) {
const id = await this.mapasService.createPoint(createPointDto);
return { id };
}

Expand Down
2 changes: 1 addition & 1 deletion src/mapas/mapas.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class MapasService {
private areaModel: Model<AreaDocument>,
) {}

async create(createPointDto: CreatePointDto) {
async createPoint(createPointDto: CreatePointDto) {
const point = new this.pointModel({
title: createPointDto.title,
description: createPointDto.description,
Expand Down
4 changes: 2 additions & 2 deletions test/mapas/mapas.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ describe('MapasController', () => {

it('should createPoint', async () => {
const module: TestingModule = await dynamicModule({
create: () => Promise.resolve('123'),
createPoint: () => Promise.resolve('123'),
});

controller = module.get<MapasController>(MapasController);

expect(
await controller.create({
await controller.createPoint({
title: 'teste',
description: 'teste',
latitude: 0,
Expand Down
4 changes: 2 additions & 2 deletions test/mapas/mapas.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('MapasService', () => {
service = module.get<MapasService>(MapasService);

expect(
await service.create({
await service.createPoint({
title: 'teste',
description: 'teste',
latitude: 0,
Expand All @@ -64,7 +64,7 @@ describe('MapasService', () => {
service = module.get<MapasService>(MapasService);

try {
await service.create({
await service.createPoint({
title: 'teste',
description: 'teste',
latitude: 0,
Expand Down

0 comments on commit c09bc68

Please sign in to comment.