Skip to content

Commit

Permalink
Merge pull request #38 from fga-eps-mds/hotfix/fix-userId-param
Browse files Browse the repository at this point in the history
hotfix - Cast userId to String
  • Loading branch information
arthurarp committed Nov 4, 2021
2 parents 7469f13 + f3270e2 commit d2fc937
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/comunidades/comunidades.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,12 @@ export class ComunidadesService {

async getUserCommunity(userEmail: string) {
const user = await this.userModel.findOne({ email: userEmail });

const userRelation = await this.userRelationModel.findOne({
userId: user._id,
userId: user._id.toString(),
});

if (!userRelation)
throw new MicrosserviceException(
throw new MicrosserviceException(
'Usuário não possui comunidade',
HttpStatus.NOT_FOUND,
);
Expand Down Expand Up @@ -239,4 +238,4 @@ export class ComunidadesService {

return users;
}
}
}

0 comments on commit d2fc937

Please sign in to comment.