From 978d12936d8bf72216d6fe373550d525c204031a Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Fri, 28 Oct 2022 15:15:53 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E7=8A=B6=E6=80=81=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/push/config.js | 2 +- api/app/lib/utils/dataRange.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/api/app/lib/controllers/push/config.js b/api/app/lib/controllers/push/config.js index f915686..d4b299e 100644 --- a/api/app/lib/controllers/push/config.js +++ b/api/app/lib/controllers/push/config.js @@ -42,7 +42,7 @@ async function list (ctx) { findOption.where.alarmType = { $contains: [alarmType] } } if (state) { - if (state == 'enable') { + if (state == 'enable' || state == 'notYet' || state == 'takeEffect') { findOption.where.disable = false } else if (state == 'disable') { findOption.where.disable = true diff --git a/api/app/lib/utils/dataRange.js b/api/app/lib/utils/dataRange.js index 14fcc6b..407c80e 100644 --- a/api/app/lib/utils/dataRange.js +++ b/api/app/lib/utils/dataRange.js @@ -207,6 +207,16 @@ module.exports = function (app, opts) { let pomsProject = [] for (let b of bindRes) { + if ( + keywordTarget == 'pepProject' && keyword + && ( + !b.name && !( + b.pepProjectId && pepProjectRes.some(pp => pp.id == b.pepProjectId) + ) + ) + ) { + continue + } if (b.pepProjectId) { let corPepProject = pepProjectRes.find(pp => pp.id == b.pepProjectId) || {} pomsProject.push({