diff --git a/api/app/lib/controllers/data/project.js b/api/app/lib/controllers/data/project.js index b1dec293..534ce7dc 100644 --- a/api/app/lib/controllers/data/project.js +++ b/api/app/lib/controllers/data/project.js @@ -3,7 +3,7 @@ async function projectGet (ctx) { try { const models = ctx.fs.dc.models; - const { type, entryName } = ctx.query; + const { type, entryName, doneState } = ctx.query; let findOption = { where: { @@ -19,6 +19,13 @@ async function projectGet (ctx) { $like: `%${entryName}%` } } + if (doneState) { + if (doneState == 'true') { + findOption.where.done = true + } else if (doneState == 'false') { + findOption.where.done = false + } + } const projectRes = await models.Project.findAll(findOption)