summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models/issue.go10
-rw-r--r--models/pull.go2
-rw-r--r--models/user.go2
-rw-r--r--models/webhook_slack.go2
-rw-r--r--routers/api/v1/convert/convert.go2
-rw-r--r--routers/api/v1/repo/issue.go2
-rw-r--r--routers/api/v1/user/user.go2
7 files changed, 11 insertions, 11 deletions
diff --git a/models/issue.go b/models/issue.go
index d3418e4449..990d4a4bc5 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -173,9 +173,9 @@ func (issue *Issue) HTMLURL() string {
// State returns string representation of issue status.
func (issue *Issue) State() api.StateType {
if issue.IsClosed {
- return api.STATE_CLOSED
+ return api.StateClosed
}
- return api.STATE_OPEN
+ return api.StateOpen
}
// APIFormat assumes some fields assigned with values:
@@ -483,7 +483,7 @@ func (issue *Issue) ChangeStatus(doer *User, repo *Repository, isClosed bool) (e
if isClosed {
apiPullRequest.Action = api.HookIssueClosed
} else {
- apiPullRequest.Action = api.HookIssueReopened
+ apiPullRequest.Action = api.HookIssueReOpened
}
err = PrepareWebhooks(repo, HookEventPullRequest, apiPullRequest)
}
@@ -1409,9 +1409,9 @@ func (m *Milestone) AfterSet(colName string, _ xorm.Cell) {
// State returns string representation of milestone status.
func (m *Milestone) State() api.StateType {
if m.IsClosed {
- return api.STATE_CLOSED
+ return api.StateClosed
}
- return api.STATE_OPEN
+ return api.StateOpen
}
// APIFormat returns this Milestone in API format.
diff --git a/models/pull.go b/models/pull.go
index f2eb895960..f1b92bff58 100644
--- a/models/pull.go
+++ b/models/pull.go
@@ -139,7 +139,7 @@ func (pr *PullRequest) APIFormat() *api.PullRequest {
if pr.Status != PullRequestStatusChecking {
mergeable := pr.Status != PullRequestStatusConflict
- apiPullRequest.Mergeable = &mergeable
+ apiPullRequest.Mergeable = mergeable
}
if pr.HasMerged {
apiPullRequest.Merged = &pr.Merged
diff --git a/models/user.go b/models/user.go
index 63544b365f..ad20abe24d 100644
--- a/models/user.go
+++ b/models/user.go
@@ -174,7 +174,7 @@ func (u *User) APIFormat() *api.User {
UserName: u.Name,
FullName: u.FullName,
Email: u.Email,
- AvatarUrl: u.AvatarLink(),
+ AvatarURL: u.AvatarLink(),
}
}
diff --git a/models/webhook_slack.go b/models/webhook_slack.go
index a872e7256c..aaeef6a001 100644
--- a/models/webhook_slack.go
+++ b/models/webhook_slack.go
@@ -157,7 +157,7 @@ func getSlackPullRequestPayload(p *api.PullRequestPayload, slack *SlackMeta) (*S
} else {
text = fmt.Sprintf("[%s] Pull request closed: %s by %s", p.Repository.FullName, titleLink, senderLink)
}
- case api.HookIssueReopened:
+ case api.HookIssueReOpened:
text = fmt.Sprintf("[%s] Pull request re-opened: %s by %s", p.Repository.FullName, titleLink, senderLink)
case api.HookIssueEdited:
text = fmt.Sprintf("[%s] Pull request edited: %s by %s", p.Repository.FullName, titleLink, senderLink)
diff --git a/routers/api/v1/convert/convert.go b/routers/api/v1/convert/convert.go
index 8608d17d99..9729e65452 100644
--- a/routers/api/v1/convert/convert.go
+++ b/routers/api/v1/convert/convert.go
@@ -115,7 +115,7 @@ func ToDeployKey(apiLink string, key *models.DeployKey) *api.DeployKey {
func ToOrganization(org *models.User) *api.Organization {
return &api.Organization{
ID: org.ID,
- AvatarUrl: org.AvatarLink(),
+ AvatarURL: org.AvatarLink(),
UserName: org.Name,
FullName: org.FullName,
Description: org.Description,
diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go
index 354678c781..462aca88ad 100644
--- a/routers/api/v1/repo/issue.go
+++ b/routers/api/v1/repo/issue.go
@@ -165,7 +165,7 @@ func EditIssue(ctx *context.APIContext, form api.EditIssueOption) {
return
}
if form.State != nil {
- if err = issue.ChangeStatus(ctx.User, ctx.Repo.Repository, api.STATE_CLOSED == api.StateType(*form.State)); err != nil {
+ if err = issue.ChangeStatus(ctx.User, ctx.Repo.Repository, api.StateClosed == api.StateType(*form.State)); err != nil {
ctx.Error(500, "ChangeStatus", err)
return
}
diff --git a/routers/api/v1/user/user.go b/routers/api/v1/user/user.go
index ef0a5b212e..20ed180ef7 100644
--- a/routers/api/v1/user/user.go
+++ b/routers/api/v1/user/user.go
@@ -38,7 +38,7 @@ func Search(ctx *context.APIContext) {
results[i] = &api.User{
ID: users[i].ID,
UserName: users[i].Name,
- AvatarUrl: users[i].AvatarLink(),
+ AvatarURL: users[i].AvatarLink(),
FullName: users[i].FullName,
}
if ctx.IsSigned {