@@ -193,7 +193,7 @@ func SubmitReview(ctx *context.Context) {
193193 }
194194 if ctx .HasError () {
195195 ctx .Flash .Error (ctx .Data ["ErrorMsg" ].(string ))
196- ctx .Redirect (fmt .Sprintf ("%s/pulls/%d/files" , ctx .Repo .RepoLink , issue .Index ))
196+ ctx .JSONRedirect (fmt .Sprintf ("%s/pulls/%d/files" , ctx .Repo .RepoLink , issue .Index ))
197197 return
198198 }
199199
@@ -214,7 +214,7 @@ func SubmitReview(ctx *context.Context) {
214214 }
215215
216216 ctx .Flash .Error (translated )
217- ctx .Redirect (fmt .Sprintf ("%s/pulls/%d/files" , ctx .Repo .RepoLink , issue .Index ))
217+ ctx .JSONRedirect (fmt .Sprintf ("%s/pulls/%d/files" , ctx .Repo .RepoLink , issue .Index ))
218218 return
219219 }
220220 }
@@ -228,14 +228,13 @@ func SubmitReview(ctx *context.Context) {
228228 if err != nil {
229229 if issues_model .IsContentEmptyErr (err ) {
230230 ctx .Flash .Error (ctx .Tr ("repo.issues.review.content.empty" ))
231- ctx .Redirect (fmt .Sprintf ("%s/pulls/%d/files" , ctx .Repo .RepoLink , issue .Index ))
231+ ctx .JSONRedirect (fmt .Sprintf ("%s/pulls/%d/files" , ctx .Repo .RepoLink , issue .Index ))
232232 } else {
233233 ctx .ServerError ("SubmitReview" , err )
234234 }
235235 return
236236 }
237-
238- ctx .Redirect (fmt .Sprintf ("%s/pulls/%d#%s" , ctx .Repo .RepoLink , issue .Index , comm .HashTag ()))
237+ ctx .JSONRedirect (fmt .Sprintf ("%s/pulls/%d#%s" , ctx .Repo .RepoLink , issue .Index , comm .HashTag ()))
239238}
240239
241240// DismissReview dismissing stale review by repo admin
0 commit comments