소스 검색

修复撤销bug

ellisran 1 년 전
부모
커밋
20f479a3b9
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      app/service/change_apply_history.js
  2. 1 1
      app/service/change_plan_history.js

+ 1 - 1
app/service/change_apply_history.js

@@ -45,7 +45,7 @@ module.exports = app => {
             const oldList = JSON.parse(data.list_json);
             // 先删后插
             await transaction.delete(this.ctx.service.changeApplyList.tableName, { caid });
-            await transaction.insert(this.ctx.service.changeApplyList.tableName, oldList);
+            if (oldList.length > 0) await transaction.insert(this.ctx.service.changeApplyList.tableName, oldList);
         }
     }
 

+ 1 - 1
app/service/change_plan_history.js

@@ -45,7 +45,7 @@ module.exports = app => {
             const oldList = JSON.parse(data.list_json);
             // 先删后插
             await transaction.delete(this.ctx.service.changePlanList.tableName, { cpid });
-            await transaction.insert(this.ctx.service.changePlanList.tableName, oldList);
+            if (oldList.length > 0) await transaction.insert(this.ctx.service.changePlanList.tableName, oldList);
         }
     }