From 44f40373cc2902fe4cce9dc8a5dab7516023a010 Mon Sep 17 00:00:00 2001 From: Riku Rauhala Date: Tue, 12 Nov 2024 21:13:30 +0200 Subject: [PATCH] [Feedback] Acually make the success message work --- services/backend/src/routes/feedback.ts | 5 +++-- services/frontend/src/pages/Feedback/index.tsx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/services/backend/src/routes/feedback.ts b/services/backend/src/routes/feedback.ts index 5bc8fee818..a4546ac7c3 100644 --- a/services/backend/src/routes/feedback.ts +++ b/services/backend/src/routes/feedback.ts @@ -1,4 +1,4 @@ -import { Request, Router } from 'express' +import { Request, Response, Router } from 'express' import { sendFeedbackToToska } from '../services/mailService' import { ApplicationError } from '../util/customErrors' @@ -12,7 +12,7 @@ interface EmailRequest extends Request { } } -router.post('/email', async (req: EmailRequest) => { +router.post('/email', async (req: EmailRequest, res: Response) => { const { content } = req.body const { user } = req @@ -26,6 +26,7 @@ router.post('/email', async (req: EmailRequest) => { }) logger.info(`${user.userId} succesfully sent feedback to Toska`) + return res.status(200).end() }) export default router diff --git a/services/frontend/src/pages/Feedback/index.tsx b/services/frontend/src/pages/Feedback/index.tsx index 9f4afdd4d5..4172c3063e 100644 --- a/services/frontend/src/pages/Feedback/index.tsx +++ b/services/frontend/src/pages/Feedback/index.tsx @@ -120,7 +120,7 @@ export const Feedback = () => { }} width="100%" > - + Sending feedback to Toska