Commit b723b364 authored by Choi Ga Young's avatar Choi Ga Young
Browse files

order 수정

parent 3d73bac1
......@@ -11,7 +11,7 @@ const findAll = async (req, res) => {
if (subjectId) findList = await Subject.findAll({ where: { [Op.and]: [{ id: subjectId }, { userId: userId }] }, order: [['updatedAt', 'DESC']] })
else findList = await Subject.findAll({ where: { userId: userId }, order: [['updatedAt', 'DESC']] })
const subjectAndPlan = await Promise.all(findList.map(async (subjectInfo) => {
const resPlan = await Plan.findAll({ where: { subjectId: subjectInfo.id } })
const resPlan = await Plan.findAll({ where: { subjectId: subjectInfo.id }, order:[[sequelize.literal('checked, deadline'), 'ASC']] })
subjectInfo.dataValues.planList = resPlan
return subjectInfo
}))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment