File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ type TaskDetailsResponse struct {
24
24
ImageUrl string `json:"image_url"`
25
25
RunSchedules []RunScheduleObject `json:"run_schedules"`
26
26
Credentials []string `json:"credentials"`
27
- EnvVars [ ]string `json:"env_vars"`
27
+ EnvVars map [ string ]string `json:"env_vars"`
28
28
ScaleConfig ScaleConfig `json:"scale_config"`
29
29
}
30
30
Original file line number Diff line number Diff line change @@ -173,13 +173,29 @@ func (r *httpRoutes) GetTask(ctx echo.Context) error {
173
173
}
174
174
}
175
175
176
+ var envVars map [string ]string
177
+ if task .EnvVars .Status == pgtype .Present {
178
+ if err := json .Unmarshal (task .EnvVars .Bytes , & envVars ); err != nil {
179
+ return err
180
+ }
181
+ }
182
+
183
+ var scaleConfig api.ScaleConfig
184
+ if task .ScaleConfig .Status == pgtype .Present {
185
+ if err = json .Unmarshal (task .ScaleConfig .Bytes , & scaleConfig ); err != nil {
186
+ return err
187
+ }
188
+ }
189
+
176
190
taskResponse := api.TaskDetailsResponse {
177
191
ID : task .ID ,
178
192
Name : task .Name ,
179
193
Description : task .Description ,
180
194
ImageUrl : task .ImageUrl ,
181
195
RunSchedules : runSchedulesObjects ,
182
196
Credentials : credentials ,
197
+ EnvVars : envVars ,
198
+ ScaleConfig : scaleConfig ,
183
199
}
184
200
185
201
return ctx .JSON (http .StatusOK , taskResponse )
You can’t perform that action at this time.
0 commit comments