hsun пре 1 година
родитељ
комит
9adb6e14e7
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      models/report.go

+ 3 - 1
models/report.go

@@ -510,9 +510,11 @@ func AddReportAndChapter(reportItem *Report, chapterItemList []*ReportChapter) (
 	if len(chapterItemList) > 0 {
 		for _, chapterItem := range chapterItemList {
 			chapterItem.ReportId = int(reportId)
-			if _, tmpErr := to.Insert(chapterItem); tmpErr != nil {
+			cpId, tmpErr := to.Insert(chapterItem)
+			if tmpErr != nil {
 				return
 			}
+			chapterItem.ReportChapterId = int(cpId)
 		}
 	}