Browse Source

feat:fix bugs

master
zhaobing’ 1 year ago
parent
commit
a685abac40
  1. 9
      api/app/lib/controllers/projectBind/projectBind.js

9
api/app/lib/controllers/projectBind/projectBind.js

@ -63,8 +63,12 @@ async function addorEditRelation(ctx, next) {
err='所选安心云结构物和巡检结构物重复!!!'
throw '所选安心云结构物和巡检结构物重复!!!'
}
await models.ProjectBind.update({ axyProjectId, structrueId }, { where: { id } })
await models.ProjectBind.update({ axyProjectId, structureId:structrueId }, { where: { id } })
ctx.status = 204
ctx.body = {
message: '编辑成功!!',
}
} else {
//新增
const res= await models.ProjectBind.findOne({ where: { axyProjectId,structureId:structrueId } })
@ -74,6 +78,9 @@ async function addorEditRelation(ctx, next) {
}
await models.ProjectBind.create({ axyProjectId, structureId:structrueId })
ctx.status = 204
ctx.body = {
message: '新增成功!!',
}
}
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`)

Loading…
Cancel
Save