aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/issue.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/issue.go')
-rw-r--r--routers/web/repo/issue.go34
1 files changed, 17 insertions, 17 deletions
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go
index e7ad02c0c2..7c4e3e36f3 100644
--- a/routers/web/repo/issue.go
+++ b/routers/web/repo/issue.go
@@ -495,7 +495,7 @@ func issueIDsFromSearch(ctx *context.Context, keyword string, opts *issues_model
// Issues render issues page
func Issues(ctx *context.Context) {
- isPullList := ctx.Params(":type") == "pulls"
+ isPullList := ctx.PathParam(":type") == "pulls"
if isPullList {
MustAllowPulls(ctx)
if ctx.Written() {
@@ -1365,13 +1365,13 @@ func getBranchData(ctx *context.Context, issue *issues_model.Issue) {
// ViewIssue render issue view page
func ViewIssue(ctx *context.Context) {
- if ctx.Params(":type") == "issues" {
+ if ctx.PathParam(":type") == "issues" {
// If issue was requested we check if repo has external tracker and redirect
extIssueUnit, err := ctx.Repo.Repository.GetUnit(ctx, unit.TypeExternalTracker)
if err == nil && extIssueUnit != nil {
if extIssueUnit.ExternalTrackerConfig().ExternalTrackerStyle == markup.IssueNameStyleNumeric || extIssueUnit.ExternalTrackerConfig().ExternalTrackerStyle == "" {
metas := ctx.Repo.Repository.ComposeMetas(ctx)
- metas["index"] = ctx.Params(":index")
+ metas["index"] = ctx.PathParam(":index")
res, err := vars.Expand(extIssueUnit.ExternalTrackerConfig().ExternalTrackerFormat, metas)
if err != nil {
log.Error("unable to expand template vars for issue url. issue: %s, err: %v", metas["index"], err)
@@ -1387,7 +1387,7 @@ func ViewIssue(ctx *context.Context) {
}
}
- issue, err := issues_model.GetIssueByIndex(ctx, ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))
+ issue, err := issues_model.GetIssueByIndex(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64(":index"))
if err != nil {
if issues_model.IsErrIssueNotExist(err) {
ctx.NotFound("GetIssueByIndex", err)
@@ -1401,10 +1401,10 @@ func ViewIssue(ctx *context.Context) {
}
// Make sure type and URL matches.
- if ctx.Params(":type") == "issues" && issue.IsPull {
+ if ctx.PathParam(":type") == "issues" && issue.IsPull {
ctx.Redirect(issue.Link())
return
- } else if ctx.Params(":type") == "pulls" && !issue.IsPull {
+ } else if ctx.PathParam(":type") == "pulls" && !issue.IsPull {
ctx.Redirect(issue.Link())
return
}
@@ -2092,7 +2092,7 @@ func sortDependencyInfo(blockers []*issues_model.DependencyInfo) {
// GetActionIssue will return the issue which is used in the context.
func GetActionIssue(ctx *context.Context) *issues_model.Issue {
- issue, err := issues_model.GetIssueByIndex(ctx, ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))
+ issue, err := issues_model.GetIssueByIndex(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64(":index"))
if err != nil {
ctx.NotFoundOrServerError("GetIssueByIndex", issues_model.IsErrIssueNotExist, err)
return nil
@@ -2157,7 +2157,7 @@ func getActionIssues(ctx *context.Context) issues_model.IssueList {
// GetIssueInfo get an issue of a repository
func GetIssueInfo(ctx *context.Context) {
- issue, err := issues_model.GetIssueWithAttrsByIndex(ctx, ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))
+ issue, err := issues_model.GetIssueWithAttrsByIndex(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64(":index"))
if err != nil {
if issues_model.IsErrIssueNotExist(err) {
ctx.Error(http.StatusNotFound)
@@ -2298,7 +2298,7 @@ func UpdateIssueContent(ctx *context.Context) {
// UpdateIssueDeadline updates an issue deadline
func UpdateIssueDeadline(ctx *context.Context) {
form := web.GetForm(ctx).(*api.EditDeadlineOption)
- issue, err := issues_model.GetIssueByIndex(ctx, ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))
+ issue, err := issues_model.GetIssueByIndex(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64(":index"))
if err != nil {
if issues_model.IsErrIssueNotExist(err) {
ctx.NotFound("GetIssueByIndex", err)
@@ -3137,7 +3137,7 @@ func NewComment(ctx *context.Context) {
// UpdateCommentContent change comment of issue's content
func UpdateCommentContent(ctx *context.Context) {
- comment, err := issues_model.GetCommentByID(ctx, ctx.ParamsInt64(":id"))
+ comment, err := issues_model.GetCommentByID(ctx, ctx.PathParamInt64(":id"))
if err != nil {
ctx.NotFoundOrServerError("GetCommentByID", issues_model.IsErrCommentNotExist, err)
return
@@ -3222,7 +3222,7 @@ func UpdateCommentContent(ctx *context.Context) {
// DeleteComment delete comment of issue
func DeleteComment(ctx *context.Context) {
- comment, err := issues_model.GetCommentByID(ctx, ctx.ParamsInt64(":id"))
+ comment, err := issues_model.GetCommentByID(ctx, ctx.PathParamInt64(":id"))
if err != nil {
ctx.NotFoundOrServerError("GetCommentByID", issues_model.IsErrCommentNotExist, err)
return
@@ -3290,7 +3290,7 @@ func ChangeIssueReaction(ctx *context.Context) {
return
}
- switch ctx.Params(":action") {
+ switch ctx.PathParam(":action") {
case "react":
reaction, err := issue_service.CreateIssueReaction(ctx, ctx.Doer, issue, form.Content)
if err != nil {
@@ -3324,7 +3324,7 @@ func ChangeIssueReaction(ctx *context.Context) {
log.Trace("Reaction for issue removed: %d/%d", ctx.Repo.Repository.ID, issue.ID)
default:
- ctx.NotFound(fmt.Sprintf("Unknown action %s", ctx.Params(":action")), nil)
+ ctx.NotFound(fmt.Sprintf("Unknown action %s", ctx.PathParam(":action")), nil)
return
}
@@ -3352,7 +3352,7 @@ func ChangeIssueReaction(ctx *context.Context) {
// ChangeCommentReaction create a reaction for comment
func ChangeCommentReaction(ctx *context.Context) {
form := web.GetForm(ctx).(*forms.ReactionForm)
- comment, err := issues_model.GetCommentByID(ctx, ctx.ParamsInt64(":id"))
+ comment, err := issues_model.GetCommentByID(ctx, ctx.PathParamInt64(":id"))
if err != nil {
ctx.NotFoundOrServerError("GetCommentByID", issues_model.IsErrCommentNotExist, err)
return
@@ -3396,7 +3396,7 @@ func ChangeCommentReaction(ctx *context.Context) {
return
}
- switch ctx.Params(":action") {
+ switch ctx.PathParam(":action") {
case "react":
reaction, err := issue_service.CreateCommentReaction(ctx, ctx.Doer, comment, form.Content)
if err != nil {
@@ -3430,7 +3430,7 @@ func ChangeCommentReaction(ctx *context.Context) {
log.Trace("Reaction for comment removed: %d/%d/%d", ctx.Repo.Repository.ID, comment.Issue.ID, comment.ID)
default:
- ctx.NotFound(fmt.Sprintf("Unknown action %s", ctx.Params(":action")), nil)
+ ctx.NotFound(fmt.Sprintf("Unknown action %s", ctx.PathParam(":action")), nil)
return
}
@@ -3504,7 +3504,7 @@ func GetIssueAttachments(ctx *context.Context) {
// GetCommentAttachments returns attachments for the comment
func GetCommentAttachments(ctx *context.Context) {
- comment, err := issues_model.GetCommentByID(ctx, ctx.ParamsInt64(":id"))
+ comment, err := issues_model.GetCommentByID(ctx, ctx.PathParamInt64(":id"))
if err != nil {
ctx.NotFoundOrServerError("GetCommentByID", issues_model.IsErrCommentNotExist, err)
return