diff --git a/api/src/routes/user.test.ts b/api/src/routes/user.test.ts index be02f2cd9b1..2bd37348a54 100644 --- a/api/src/routes/user.test.ts +++ b/api/src/routes/user.test.ts @@ -723,9 +723,11 @@ describe('userRoutes', () => { }); test('POST returns 200 status code with "success" message', async () => { - const testUser = await fastifyTestInstance.prisma.user.findFirst({ - where: { email: testUserData.email } - }); + const testUser = await fastifyTestInstance.prisma.user.findFirstOrThrow( + { + where: { email: testUserData.email } + } + ); const response = await superRequest('/user/report-user', { method: 'POST', setCookies @@ -751,8 +753,8 @@ Luke, I am your father Reported by: -Username: ${testUser?.username ?? ''} -Name: +Username: ${testUser.username} +Name: Email: foo@bar.com Thanks and regards, diff --git a/api/src/utils/email-templates.ts b/api/src/utils/email-templates.ts index b7d73c566b6..31373c59ec9 100644 --- a/api/src/utils/email-templates.ts +++ b/api/src/utils/email-templates.ts @@ -24,7 +24,7 @@ ${reportDesc} Reported by: Username: ${reporter.username} -Name: ${reporter.name ?? ''} +Name:${reporter.name ? ' ' + reporter.name : ''} Email: ${reporter.email} Thanks and regards,