Skip to content

Commit

Permalink
Update historyController.js
Browse files Browse the repository at this point in the history
  • Loading branch information
RickyRAV committed Jun 10, 2024
1 parent 0a82e5d commit 1691909
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 @@ -42,7 +42,7 @@ const userHistory = async (req, res) => {
}

// extract topics and flatten the array
const topics = allQuizzes.flatMap(quiz => quiz.topics);
const topics = allQuizzes.flatMap(quiz => quiz.topics.map(topic => topic.toLowerCase()));

// count the occurrence of each topic
const topicCounts = topics.reduce((counts, topic) => {
Expand Down

0 comments on commit 1691909

Please sign in to comment.