From 80e3cae8babd6094f7b779ff8807d457a2e2fa22 Mon Sep 17 00:00:00 2001 From: Duncan Carter Date: Thu, 9 Jan 2025 16:42:12 +0000 Subject: [PATCH] Add send to updateLastViewedVacanciesAndTurnoverMessage to stop endpoint response timing out --- backend/server/routes/accounts/user.js | 2 +- backend/server/test/unit/routes/accounts/user.spec.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/server/routes/accounts/user.js b/backend/server/routes/accounts/user.js index 1e2361b660..e9e2f1f672 100644 --- a/backend/server/routes/accounts/user.js +++ b/backend/server/routes/accounts/user.js @@ -921,7 +921,7 @@ const updateLastViewedVacanciesAndTurnoverMessage = async (req, res) => { await models.user.setDateForLastViewedVacanciesAndTurnoverMessage(userUid); - return res.status(200); + return res.status(200).send('Last viewed date updated'); } catch (error) { return res.status(500).send('Failed to update last viewed date'); } diff --git a/backend/server/test/unit/routes/accounts/user.spec.js b/backend/server/test/unit/routes/accounts/user.spec.js index 157ae04e40..42a737f932 100644 --- a/backend/server/test/unit/routes/accounts/user.spec.js +++ b/backend/server/test/unit/routes/accounts/user.spec.js @@ -369,6 +369,7 @@ describe('user.js', () => { await updateLastViewedVacanciesAndTurnoverMessage(req, res); expect(res.statusCode).to.equal(200); + expect(res._getData()).to.deep.equal('Last viewed date updated'); }); it('should return 400 response if userUid in params invalid', async () => {