diff --git a/api/app/lib/controllers/push/config.js b/api/app/lib/controllers/push/config.js index 21c630a..630b649 100644 --- a/api/app/lib/controllers/push/config.js +++ b/api/app/lib/controllers/push/config.js @@ -171,6 +171,20 @@ async function edit (ctx) { name, pomsProjectId, alarmType, receiverPepUserId, timeType, disable, strucId, tactics, tacticsParams } + + let repeatOption = { + where: { + name, + del: false, + } + } + if (pushId) { + repeatOption.where.id = { $ne: pushId } + } + if (repeatOption) { + throw `已有名称为[${name}]的同名策略` + } + let repeatRes = await models.findOne(repeatOption) if (pushId) { await models.AlarmPushConfig.update(storageData, { where: {