Skip to content

Commit

Permalink
Merge pull request #829 from Sanofi-IADC/feature/WEB-2070-tags
Browse files Browse the repository at this point in the history
feat(WEB-2070): WEB-2070 added log statements to check errors
  • Loading branch information
sairam459 committed Apr 4, 2024
2 parents 9d0ceb5 + 06374b1 commit 0ffed0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/whisp/whisp.resolver.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Inject, UseGuards } from '@nestjs/common';
import { Inject, Logger, UseGuards } from '@nestjs/common';
import {
Args,
Int,
Expand All @@ -25,6 +25,8 @@ import { WhispCount } from './whispCount.entity';
@Resolver(() => Whisp)
@UseGuards(GqlJwtAuthGuard)
export class WhispResolver {
private readonly logger = new Logger(WhispService.name);

constructor(
private readonly whispService: WhispService,
private readonly distributionService: DistributionService,
Expand Down Expand Up @@ -124,6 +126,7 @@ export class WhispResolver {
@ResolveField(() => [Tag])
async tags(@Root() whisp: Whisp): Promise<TagInputType[]> {
// eslint-disable-next-line no-underscore-dangle
this.logger.log('Test logging whisp', JSON.stringify(whisp));
return this.whispService.findTagsByWhispId(whisp._id);
}
}
1 change: 1 addition & 0 deletions src/whisp/whisp.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export class WhispService {
}

async findTagsByWhispId(whispId: string): Promise<TagInputType[]> {
this.logger.log('Test logging whispId', whispId);
const whisps = await this.whispModel.findById(whispId).populate('tags').exec();
return whisps.tags;
}
Expand Down

0 comments on commit 0ffed0f

Please sign in to comment.