@@ -106,25 +106,19 @@ func (s *server) markDeployedPR(w http.ResponseWriter, req *http.Request) {
106106 }
107107
108108 if team == "" || commitSHA == "" {
109-
110- var preconditionFailed struct {
111- Errors []string
112- }
113-
114- preconditionFailed .Errors = make ([]string , 0 , 1 )
115- preconditionFailed .Errors = append (preconditionFailed .Errors , fmt .Sprintf ("team and commit are required parameters. Team: '%v', commit: '%v'" , team , commitSHA ))
116-
117109 s .log .WithFields (
118110 logrus.Fields {
119111 "team" : team ,
120112 "commit" : commitSHA ,
121113 },
122114 ).Error ("team and commit are required parameters" )
123115
124- w .Header ().Set ("Content-Type" , "application/json; charset=utf-8" )
125- w .Header ().Set ("X-Content-Type-Options" , "nosniff" )
126116 w .WriteHeader (http .StatusPreconditionFailed )
127- json .NewEncoder (w ).Encode (preconditionFailed )
117+ enc := json .NewEncoder (w )
118+ enc .SetIndent ("" , " " )
119+ enc .Encode (map [string ]string {
120+ "error" : "team and commit are required parameters" ,
121+ })
128122 return
129123 }
130124
@@ -161,9 +155,9 @@ func (s *server) markDeployedPR(w http.ResponseWriter, req *http.Request) {
161155 Team []string `json:"team"`
162156 All []string `json:"all"`
163157 } `json:"deployedPRs"`
164- Errors []error `json:"errors"`
158+ Errors []string `json:"errors"`
165159 }
166- msg .DeployedPRs .Team , msg .DeployedPRs .All , msg . Errors = s .handleMarkDeployedPRs (req .Context (), commitSHA , team )
160+ msg .DeployedPRs .Team , msg .DeployedPRs .All , errs = s .handleMarkDeployedPRs (req .Context (), commitSHA , team )
167161
168162 msg .Errors = make ([]string , 0 , len (errs ))
169163 for _ , err := range errs {
0 commit comments