File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -225,14 +225,15 @@ func EditMilestonePost(ctx *context.Context) {
225225
226226// ChangeMilestoneStatus response for change a milestone's status
227227func ChangeMilestoneStatus (ctx * context.Context ) {
228- toClose := false
228+ var toClose bool
229229 switch ctx .Params (":action" ) {
230230 case "open" :
231231 toClose = false
232232 case "close" :
233233 toClose = true
234234 default :
235- ctx .Redirect (ctx .Repo .RepoLink + "/milestones" )
235+ ctx .JSONRedirect (ctx .Repo .RepoLink + "/milestones" )
236+ return
236237 }
237238 id := ctx .ParamsInt64 (":id" )
238239
@@ -244,7 +245,7 @@ func ChangeMilestoneStatus(ctx *context.Context) {
244245 }
245246 return
246247 }
247- ctx .Redirect (ctx .Repo .RepoLink + "/milestones?state=" + url .QueryEscape (ctx .Params (":action" )))
248+ ctx .JSONRedirect (ctx .Repo .RepoLink + "/milestones?state=" + url .QueryEscape (ctx .Params (":action" )))
248249}
249250
250251// DeleteMilestone delete a milestone
Original file line number Diff line number Diff line change @@ -161,14 +161,15 @@ func NewProjectPost(ctx *context.Context) {
161161
162162// ChangeProjectStatus updates the status of a project between "open" and "close"
163163func ChangeProjectStatus (ctx * context.Context ) {
164- toClose := false
164+ var toClose bool
165165 switch ctx .Params (":action" ) {
166166 case "open" :
167167 toClose = false
168168 case "close" :
169169 toClose = true
170170 default :
171- ctx .Redirect (ctx .Repo .RepoLink + "/projects" )
171+ ctx .JSONRedirect (ctx .Repo .RepoLink + "/projects" )
172+ return
172173 }
173174 id := ctx .ParamsInt64 (":id" )
174175
@@ -180,7 +181,7 @@ func ChangeProjectStatus(ctx *context.Context) {
180181 }
181182 return
182183 }
183- ctx .Redirect (ctx .Repo .RepoLink + "/projects?state=" + url .QueryEscape (ctx .Params (":action" )))
184+ ctx .JSONRedirect (ctx .Repo .RepoLink + "/projects?state=" + url .QueryEscape (ctx .Params (":action" )))
184185}
185186
186187// DeleteProject delete a project
You can’t perform that action at this time.
0 commit comments