From 1914b5a6e0042cb9152464f772999757566b81a9 Mon Sep 17 00:00:00 2001 From: RickyRav Date: Wed, 22 May 2024 10:55:23 +0200 Subject: [PATCH] Update historyController.js --- controllers/historyController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/historyController.js b/controllers/historyController.js index 6f46475..55a9dc9 100644 --- a/controllers/historyController.js +++ b/controllers/historyController.js @@ -51,7 +51,7 @@ const userHistory = async (req, res) => { // return the top five topics without their occurrence count const topFiveTopics = sortedTopics.slice(0, 5).map(topic => ({ - name: topic[0].toUpperCase(), + name: topic[0].split(' ').map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(' '), topic_frequency: topic[1] }));