From f88da970551e025ae13d9e8ac96a088c6decbfbf Mon Sep 17 00:00:00 2001 From: elangptra Date: Thu, 24 Oct 2024 09:19:12 +0700 Subject: [PATCH] refactor: stdLearning history function --- controllers/learningControllers/stdLearning.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/controllers/learningControllers/stdLearning.js b/controllers/learningControllers/stdLearning.js index be70d41..490e39e 100644 --- a/controllers/learningControllers/stdLearning.js +++ b/controllers/learningControllers/stdLearning.js @@ -252,6 +252,9 @@ export const learningHistory = async (req, res) => { const stdLearnings = await models.StdLearning.findAll({ where: { ID }, + STUDENT_FINISH: { + [models.Sequelize.Op.ne]: null, + }, include: [ { model: models.Level, @@ -349,6 +352,9 @@ export const learningHistoryBySectionId = async (req, res) => { const stdLearnings = await models.StdLearning.findAll({ where: { ID }, + STUDENT_FINISH: { + [models.Sequelize.Op.ne]: null, + }, include: [ { model: models.Level, @@ -451,6 +457,9 @@ export const learningHistoryByTopicId = async (req, res) => { const stdLearnings = await models.StdLearning.findAll({ where: { ID }, + STUDENT_FINISH: { + [models.Sequelize.Op.ne]: null, + }, include: [ { model: models.Level,