From 406547c1e9c562fe0a1a9842c0681c3edbe40d16 Mon Sep 17 00:00:00 2001 From: Maria Afonina <104988390+MariaAfonina@users.noreply.github.com> Date: Fri, 17 Nov 2023 15:02:40 +0200 Subject: [PATCH] Added fields to getQuizById (#633) --- services/quiz.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/quiz.js b/services/quiz.js index 49a6c819..fd7580d6 100644 --- a/services/quiz.js +++ b/services/quiz.js @@ -17,7 +17,7 @@ const quizService = { }, getQuizById: async (id) => { - return await Quiz.findById(id).lean().exec() + return await Quiz.findById(id).populate({ path: 'items', select: 'title answers text' }).lean().exec() }, createQuiz: async (author, data) => {