From d6050563f5a74724e1bc217dff6f005052dd941d Mon Sep 17 00:00:00 2001 From: Sairam Charan Date: Thu, 4 Apr 2024 18:38:09 +0530 Subject: [PATCH 1/2] feat(WEB-2070): WEB-2070 added log statements to check errors --- src/whisp/whisp.resolver.ts | 3 ++- src/whisp/whisp.service.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/whisp/whisp.resolver.ts b/src/whisp/whisp.resolver.ts index 78ab134cf..f82801e81 100644 --- a/src/whisp/whisp.resolver.ts +++ b/src/whisp/whisp.resolver.ts @@ -1,4 +1,4 @@ -import { Inject, UseGuards } from '@nestjs/common'; +import { Inject, Logger, UseGuards } from '@nestjs/common'; import { Args, Int, @@ -124,6 +124,7 @@ export class WhispResolver { @ResolveField(() => [Tag]) async tags(@Root() whisp: Whisp): Promise { // eslint-disable-next-line no-underscore-dangle + Logger.log('Test logging whisp', JSON.stringify(whisp) ); return this.whispService.findTagsByWhispId(whisp._id); } } diff --git a/src/whisp/whisp.service.ts b/src/whisp/whisp.service.ts index 86b8ed34c..68d37dc1d 100644 --- a/src/whisp/whisp.service.ts +++ b/src/whisp/whisp.service.ts @@ -127,6 +127,7 @@ export class WhispService { } async findTagsByWhispId(whispId: string): Promise { + Logger.log('Test logging whispId', whispId ); const whisps = await this.whispModel.findById(whispId).populate('tags').exec(); return whisps.tags; } From 5b26434a9d513e7ebd8921d035eb7b522230f825 Mon Sep 17 00:00:00 2001 From: Sairam Charan Date: Thu, 4 Apr 2024 18:51:53 +0530 Subject: [PATCH 2/2] feat(WEB-2070): WEB-2070 lint fixes --- src/whisp/whisp.resolver.ts | 4 +++- src/whisp/whisp.service.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/whisp/whisp.resolver.ts b/src/whisp/whisp.resolver.ts index f82801e81..cee22c887 100644 --- a/src/whisp/whisp.resolver.ts +++ b/src/whisp/whisp.resolver.ts @@ -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, @@ -124,7 +126,7 @@ export class WhispResolver { @ResolveField(() => [Tag]) async tags(@Root() whisp: Whisp): Promise { // eslint-disable-next-line no-underscore-dangle - Logger.log('Test logging whisp', JSON.stringify(whisp) ); + this.logger.log('Test logging whisp', JSON.stringify(whisp)); return this.whispService.findTagsByWhispId(whisp._id); } } diff --git a/src/whisp/whisp.service.ts b/src/whisp/whisp.service.ts index 68d37dc1d..9a82e9688 100644 --- a/src/whisp/whisp.service.ts +++ b/src/whisp/whisp.service.ts @@ -127,7 +127,7 @@ export class WhispService { } async findTagsByWhispId(whispId: string): Promise { - Logger.log('Test logging whispId', whispId ); + this.logger.log('Test logging whispId', whispId); const whisps = await this.whispModel.findById(whispId).populate('tags').exec(); return whisps.tags; }