From 341a650efd806abe1c66d85267a1cb00b36a2c8e Mon Sep 17 00:00:00 2001 From: pallavicoder Date: Fri, 4 Oct 2024 20:46:03 +0530 Subject: [PATCH] fix:fixed-sonar-issues Signed-off-by: pallavicoder --- .env.sample | 4 +++- apps/api-gateway/src/issuance/issuance.controller.ts | 4 ++-- apps/issuance/src/issuance.service.ts | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.env.sample b/.env.sample index ab264988d..cbcf1ca6f 100644 --- a/.env.sample +++ b/.env.sample @@ -152,4 +152,6 @@ ENABLE_CORS_IP_LIST="" # Provide a list of domains that are allowed to use this SCHEMA_FILE_SERVER_URL= // Please provide schema URL SCHEMA_FILE_SERVER_TOKEN=xxxxxxxx // Please provide schema file server token for polygon -FILEUPLOAD_CACHE_TTL= //Provide file upload cache ttl \ No newline at end of file +FILEUPLOAD_CACHE_TTL= //Provide file upload cache ttl + +FIELD_UPLOAD_SIZE= //Provide field upload size \ No newline at end of file diff --git a/apps/api-gateway/src/issuance/issuance.controller.ts b/apps/api-gateway/src/issuance/issuance.controller.ts index f15c50157..ac0341ee9 100644 --- a/apps/api-gateway/src/issuance/issuance.controller.ts +++ b/apps/api-gateway/src/issuance/issuance.controller.ts @@ -401,8 +401,8 @@ async downloadBulkIssuanceCSVTemplate( required: true }) @UseInterceptors(FileInterceptor('file', { - limits: { fieldSize: 100 * 1024 * 1024 } - })) + limits: { fieldSize: Number(process.env.FIELD_UPLOAD_SIZE) || 100 * 1024 * 1024 } + })) async issueBulkCredentials( @Body() clientDetails: ClientDetails, diff --git a/apps/issuance/src/issuance.service.ts b/apps/issuance/src/issuance.service.ts index 80032547d..b2119288f 100644 --- a/apps/issuance/src/issuance.service.ts +++ b/apps/issuance/src/issuance.service.ts @@ -48,12 +48,12 @@ export class IssuanceService { private readonly commonService: CommonService, private readonly issuanceRepository: IssuanceRepository, private readonly userActivityRepository: UserActivityRepository, - @Inject(CACHE_MANAGER) private cacheManager: Cache, + @Inject(CACHE_MANAGER) private readonly cacheManager: Cache, private readonly outOfBandIssuance: OutOfBandIssuance, private readonly emailData: EmailDto, private readonly awsService: AwsService, - @InjectQueue('bulk-issuance') private bulkIssuanceQueue: Queue, - @Inject(CACHE_MANAGER) private cacheService: Cache + @InjectQueue('bulk-issuance') private readonly bulkIssuanceQueue: Queue, + @Inject(CACHE_MANAGER) private readonly cacheService: Cache ) { } async getIssuanceRecords(orgId: string): Promise {