Parcourir la source

修复撤销bug

ellisran il y a 1 an
Parent
commit
20f479a3b9
2 fichiers modifiés avec 2 ajouts et 2 suppressions
  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);
         }
     }