EUGENIO SOUZA CARVALHO 3 years ago
parent
commit
cfd3ddaf16
2 changed files with 10 additions and 7 deletions
  1. 1 0
      api/debug.go
  2. 9 7
      translate/got/constants.go

+ 1 - 0
api/debug.go

@@ -44,6 +44,7 @@ func NewDebugTaks() *DebugTaks {
 func (debug *DebugTaks) Stage(id string) *DebugStage {
 	stage := &DebugStage{}
 	stage.ID = id
+	debug.Stages = append(debug.Stages, stage)
 	debug.CurrentStage = stage
 	return stage
 }

+ 9 - 7
translate/got/constants.go

@@ -34,17 +34,19 @@ func CreateVariables(p *Project) error {
 			).Params(
 				G.Id("ctx").Qual(IRIS_CTX, "Context"),
 			).Id(` *`).Qual(API_URL, "Filter").Id(`{
-				var session `).Qual(MONGO, "SessionContext").Id(`
+				var (
+					options = &api.Filter{
+						DB:`).Id(dbid).Id(`,
+						Collection:`).Id(collectionid).Id(`,
+					}
+				)
 				
 				if ctx != nil {
-					session = api.GetSessionContext(ctx)
+					options.Context = ctx
+					options.SessionContext = api.GetSessionContext(ctx)
 				}
 
-				return &api.Filter{
-					DB:`).Id(dbid).Id(`,
-					Collection:`).Id(collectionid).Id(`,
-					SessionContext: session,
-				}
+				return options
 			} 
 			`).Line())