@@ -193,6 +193,9 @@ func updateStage(c *gin.Context, db *mongo.Collection, req *StageRequest) (inter
if err != nil {
return nil, fmt.Errorf("invalid planId: %v", err)
}
+ if len(req.Stages) == 0 {
+ return nil, fmt.Errorf("stages array cannot be empty")
+ }
// 构建更新操作
update := bson.M{