summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/repo')
-rw-r--r--routers/api/v1/repo/issue.go7
-rw-r--r--routers/api/v1/repo/issue_label.go8
-rw-r--r--routers/api/v1/repo/label.go4
3 files changed, 11 insertions, 8 deletions
diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go
index 25664e45a9..217c97c69b 100644
--- a/routers/api/v1/repo/issue.go
+++ b/routers/api/v1/repo/issue.go
@@ -81,8 +81,10 @@ func SearchIssues(ctx *context.APIContext) {
AllPublic: true,
TopicOnly: false,
Collaborate: util.OptionalBoolNone,
- OrderBy: models.SearchOrderByRecentUpdated,
- Actor: ctx.User,
+ // This needs to be a column that is not nil in fixtures or
+ // MySQL will return different results when sorting by null in some cases
+ OrderBy: models.SearchOrderByAlphabetically,
+ Actor: ctx.User,
}
if ctx.IsSigned {
opts.Private = true
@@ -152,6 +154,7 @@ func SearchIssues(ctx *context.APIContext) {
Page: ctx.QueryInt("page"),
PageSize: setting.UI.IssuePagingNum,
},
+
RepoIDs: repoIDs,
IsClosed: isClosed,
IssueIDs: issueIDs,
diff --git a/routers/api/v1/repo/issue_label.go b/routers/api/v1/repo/issue_label.go
index 8089891265..8b2a1988fa 100644
--- a/routers/api/v1/repo/issue_label.go
+++ b/routers/api/v1/repo/issue_label.go
@@ -171,12 +171,12 @@ func DeleteIssueLabel(ctx *context.APIContext) {
return
}
- label, err := models.GetLabelInRepoByID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id"))
+ label, err := models.GetLabelByID(ctx.ParamsInt64(":id"))
if err != nil {
if models.IsErrLabelNotExist(err) {
ctx.Error(http.StatusUnprocessableEntity, "", err)
} else {
- ctx.Error(http.StatusInternalServerError, "GetLabelInRepoByID", err)
+ ctx.Error(http.StatusInternalServerError, "GetLabelByID", err)
}
return
}
@@ -308,9 +308,9 @@ func prepareForReplaceOrAdd(ctx *context.APIContext, form api.IssueLabelsOption)
return
}
- labels, err = models.GetLabelsInRepoByIDs(ctx.Repo.Repository.ID, form.Labels)
+ labels, err = models.GetLabelsByIDs(form.Labels)
if err != nil {
- ctx.Error(http.StatusInternalServerError, "GetLabelsInRepoByIDs", err)
+ ctx.Error(http.StatusInternalServerError, "GetLabelsByIDs", err)
return
}
diff --git a/routers/api/v1/repo/label.go b/routers/api/v1/repo/label.go
index 95dbbc9551..5f70e74407 100644
--- a/routers/api/v1/repo/label.go
+++ b/routers/api/v1/repo/label.go
@@ -96,7 +96,7 @@ func GetLabel(ctx *context.APIContext) {
label, err = models.GetLabelInRepoByID(ctx.Repo.Repository.ID, intID)
}
if err != nil {
- if models.IsErrLabelNotExist(err) {
+ if models.IsErrRepoLabelNotExist(err) {
ctx.NotFound()
} else {
ctx.Error(http.StatusInternalServerError, "GetLabelByRepoID", err)
@@ -197,7 +197,7 @@ func EditLabel(ctx *context.APIContext, form api.EditLabelOption) {
label, err := models.GetLabelInRepoByID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id"))
if err != nil {
- if models.IsErrLabelNotExist(err) {
+ if models.IsErrRepoLabelNotExist(err) {
ctx.NotFound()
} else {
ctx.Error(http.StatusInternalServerError, "GetLabelByRepoID", err)