Skip to content

Commit

Permalink
Update historyController.js
Browse files Browse the repository at this point in the history
  • Loading branch information
RickyRAV committed May 22, 2024
1 parent b83678a commit 1914b5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/historyController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}));

Expand Down

0 comments on commit 1914b5a

Please sign in to comment.