animeic 2 years ago
parent
commit
1ac2252839
1 changed files with 5 additions and 0 deletions
  1. 5 0
      boxcost/api/craft.go

+ 5 - 0
boxcost/api/craft.go

@@ -102,6 +102,11 @@ func UpdateCraft(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 	if craft.Id.Hex() == "" {
 		return nil, errors.New("id的为空")
 	}
+
+	// if remark = ""
+	if craft.Remark == "" {
+		craft.Remark = " "
+	}
 	craft.UpdateTime = time.Now()
 	return repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionCraft, craft.Id.Hex(), &craft)
 }