Skip to content

Commit

Permalink
hotfix - Fix addToCommunity and getcommunityData endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur <arthurarp@hotmail.com>
  • Loading branch information
arthurarp committed Nov 4, 2021
1 parent 986a250 commit ec69fd2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/mapas/mapas.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class MapasController {
}

@MessagePattern('getCommunityData')
async getCommunityData(@Payload('id') communityId: string) {
async getCommunityData(@Payload() communityId: string) {
return this.mapasService.getCommunityData(communityId);
}
}
6 changes: 1 addition & 5 deletions src/mapas/mapas.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export class MapasService {

private async getPoint(id: string) {
const point = await this.pointModel.findById(id);

if (!point)
throw new MicrosserviceException(
'Ponto não encontrada',
Expand Down Expand Up @@ -272,7 +271,6 @@ export class MapasService {
found = null;
}
}

return found;
}

Expand Down Expand Up @@ -323,12 +321,10 @@ export class MapasService {
const relations = await this.communityRelationModel.find({
communityId: communityId,
});

for (const relation of relations) {
const locationObject = await this.getPointOrAreaWithMedia(
relation.communityId,
relation.locationId,
);

if (locationObject instanceof PointDto) {
communityDataDto.points.push(locationObject);
}
Expand Down

0 comments on commit ec69fd2

Please sign in to comment.