Skip to content

Commit

Permalink
fix [feat/#160]
Browse files Browse the repository at this point in the history
  • Loading branch information
locxuandao committed Apr 4, 2023
1 parent f972743 commit 84fa095
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/apis/v1/questions/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ export const getQuestionsByExamId = async function (examId: string) {
'-is_blocked -roles -created_at -updated_at -__v'
);

const exam = ExamModel.findOne({ _id: examId });

const exam = ExamModel.findOne({ _id: examId }).populate('subject', '-is_deleted -created_at -updated_at -__v');
const resultAll = await Promise.all([data, exam]);

return {
Expand Down
2 changes: 1 addition & 1 deletion src/models/schema/Question.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import AnswerSchema from './Answer';

const QuestionSchema = new Schema<Question>(
{
author: { type: Schema.Types.ObjectId, required: true },
author: { type: Schema.Types.ObjectId, ref: MODELS.user, required: true },
exam_id: { type: Schema.Types.ObjectId, required: true },
content: { type: String, required: true },
image: { type: String },
Expand Down

0 comments on commit 84fa095

Please sign in to comment.