diff --git a/src/services/profile/profile-router.test.ts b/src/services/profile/profile-router.test.ts index 3b26d15b..8275cb6d 100644 --- a/src/services/profile/profile-router.test.ts +++ b/src/services/profile/profile-router.test.ts @@ -7,7 +7,7 @@ beforeEach(async () => { Models.initialize(); }); -let profile: ProfileFormat = { +const profile: ProfileFormat = { userId: TESTER.id, displayName: TESTER.name, avatarUrl: TESTER.avatarUrl, diff --git a/src/services/profile/profile-router.ts b/src/services/profile/profile-router.ts index f96a2937..057d12df 100644 --- a/src/services/profile/profile-router.ts +++ b/src/services/profile/profile-router.ts @@ -270,7 +270,10 @@ profileRouter.delete("/", strongJwtVerification, async (_: Request, res: Respons const attendeeProfileDeleteResponse: DeleteResult = await Models.AttendeeProfile.deleteOne({ userId: decodedData.id }); const attendeeMetadataDeleteResponse: DeleteResult = await Models.AttendeeMetadata.deleteOne({ userId: decodedData.id }); - if (attendeeMetadataDeleteResponse.deletedCount == 0 || attendeeProfileDeleteResponse.deletedCount == 0) { + if ( + attendeeMetadataDeleteResponse.deletedCount == Constants.ZERO || + attendeeProfileDeleteResponse.deletedCount == Constants.ZERO + ) { return res.status(Constants.NOT_FOUND).send({ success: false, error: "AttendeeNotFound" }); } return res.status(Constants.SUCCESS).send({ success: true });