Browse Source

策略判重

dev
巴林闲侠 3 years ago
parent
commit
230750817d
  1. 14
      api/app/lib/controllers/push/config.js

14
api/app/lib/controllers/push/config.js

@ -171,6 +171,20 @@ async function edit (ctx) {
name, pomsProjectId, alarmType, receiverPepUserId, timeType, disable, name, pomsProjectId, alarmType, receiverPepUserId, timeType, disable,
strucId, tactics, tacticsParams 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) { if (pushId) {
await models.AlarmPushConfig.update(storageData, { await models.AlarmPushConfig.update(storageData, {
where: { where: {

Loading…
Cancel
Save