From 6bff32bf79d3d67938de8dcf1acbcb56db5c3661 Mon Sep 17 00:00:00 2001 From: Behzad-rabiei Date: Wed, 19 Feb 2025 12:25:11 +0100 Subject: [PATCH] fix: return 404 on not found ideintity --- src/services/platform.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/platform.service.ts b/src/services/platform.service.ts index f9e40f5..47358f3 100644 --- a/src/services/platform.service.ts +++ b/src/services/platform.service.ts @@ -312,7 +312,7 @@ const validatePlatformUpdate = (platform: IAuthAndPlatform['platform'], body: IA const getReputationScore = async (platform: HydratedDocument, user: HydratedDocument) => { const identity = user.identities.find((id) => id.provider === platform.name); if (!identity) { - throw new ApiError(httpStatus.BAD_REQUEST, `User need to login with the ${platform.name} account`); + throw new ApiError(httpStatus.NOT_FOUND, `User need to login with the ${platform.name} account`); } return { reputationScore: (await reputationScoreService.calculateReputationScoreForUser(platform, identity.id)) * 100,