From 5350dbf73a00370b401677b06ebb30c64021d4fe Mon Sep 17 00:00:00 2001 From: Anonymus2000 <54113952+Nil2000@users.noreply.github.com> Date: Tue, 10 Sep 2024 11:51:04 +0530 Subject: [PATCH] fix(api): Error messages fixed in api-key service (#418) --- apps/api/src/api-key/service/api-key.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/api/src/api-key/service/api-key.service.ts b/apps/api/src/api-key/service/api-key.service.ts index f0ac4f1d..66c6e6dc 100644 --- a/apps/api/src/api-key/service/api-key.service.ts +++ b/apps/api/src/api-key/service/api-key.service.ts @@ -93,7 +93,7 @@ export class ApiKeyService { const apiKeyId = apiKey.id if (!apiKey) { - throw new NotFoundException(`API key with id ${apiKeyId} not found`) + throw new NotFoundException(`API key ${apiKeySlug} not found`) } const updatedApiKey = await this.prisma.apiKey.update({ @@ -137,7 +137,7 @@ export class ApiKeyService { } }) } catch (error) { - throw new NotFoundException(`API key with id ${apiKeySlug} not found`) + throw new NotFoundException(`API key ${apiKeySlug} not found`) } this.logger.log(`User ${user.id} deleted API key ${apiKeySlug}`) @@ -161,7 +161,7 @@ export class ApiKeyService { }) if (!apiKey) { - throw new NotFoundException(`API key with id ${apiKeySlug} not found`) + throw new NotFoundException(`API key ${apiKeySlug} not found`) } return apiKey