@@ -90,6 +90,18 @@ func AddStage(c *gin.Context, apictx *ApiSession) (interface{}, error) {
"updateTime": time.Now(),
},
}
+
+ if req.Stages == nil {
+ update = bson.M{
+ "$push": bson.M{
+ "pack.components.$[components].stages": bson.M{
+ "$each": []string{},
+ },
+ }
arrayFilters := []interface{}{
bson.M{"components.id": req.CompId},