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 @@ -231,14 +231,15 @@ func EditMilestonePost(ctx *context.Context) {
231231
232232// ChangeMilestoneStatus response for change a milestone's status
233233func ChangeMilestoneStatus (ctx * context.Context ) {
234- toClose := false
234+ var toClose bool
235235 switch ctx .Params (":action" ) {
236236 case "open" :
237237 toClose = false
238238 case "close" :
239239 toClose = true
240240 default :
241- ctx .Redirect (ctx .Repo .RepoLink + "/milestones" )
241+ ctx .JSONRedirect (ctx .Repo .RepoLink + "/milestones" )
242+ return
242243 }
243244 id := ctx .ParamsInt64 (":id" )
244245
@@ -250,7 +251,7 @@ func ChangeMilestoneStatus(ctx *context.Context) {
250251 }
251252 return
252253 }
253- ctx .Redirect (ctx .Repo .RepoLink + "/milestones?state=" + url .QueryEscape (ctx .Params (":action" )))
254+ ctx .JSONRedirect (ctx .Repo .RepoLink + "/milestones?state=" + url .QueryEscape (ctx .Params (":action" )))
254255}
255256
256257// 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