File tree 2 files changed +8
-6
lines changed 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) {
225
225
226
226
// ChangeMilestoneStatus response for change a milestone's status
227
227
func ChangeMilestoneStatus (ctx * context.Context ) {
228
- toClose := false
228
+ var toClose bool
229
229
switch ctx .Params (":action" ) {
230
230
case "open" :
231
231
toClose = false
232
232
case "close" :
233
233
toClose = true
234
234
default :
235
- ctx .Redirect (ctx .Repo .RepoLink + "/milestones" )
235
+ ctx .JSONRedirect (ctx .Repo .RepoLink + "/milestones" )
236
+ return
236
237
}
237
238
id := ctx .ParamsInt64 (":id" )
238
239
@@ -244,7 +245,7 @@ func ChangeMilestoneStatus(ctx *context.Context) {
244
245
}
245
246
return
246
247
}
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" )))
248
249
}
249
250
250
251
// DeleteMilestone delete a milestone
Original file line number Diff line number Diff line change @@ -161,14 +161,15 @@ func NewProjectPost(ctx *context.Context) {
161
161
162
162
// ChangeProjectStatus updates the status of a project between "open" and "close"
163
163
func ChangeProjectStatus (ctx * context.Context ) {
164
- toClose := false
164
+ var toClose bool
165
165
switch ctx .Params (":action" ) {
166
166
case "open" :
167
167
toClose = false
168
168
case "close" :
169
169
toClose = true
170
170
default :
171
- ctx .Redirect (ctx .Repo .RepoLink + "/projects" )
171
+ ctx .JSONRedirect (ctx .Repo .RepoLink + "/projects" )
172
+ return
172
173
}
173
174
id := ctx .ParamsInt64 (":id" )
174
175
@@ -180,7 +181,7 @@ func ChangeProjectStatus(ctx *context.Context) {
180
181
}
181
182
return
182
183
}
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" )))
184
185
}
185
186
186
187
// DeleteProject delete a project
You can’t perform that action at this time.
0 commit comments