mirror of
https://github.com/go-gitea/gitea.git
synced 2025-10-03 00:02:14 -04:00
Compare commits
5 Commits
05fba3e4d8
...
67c98f4d73
Author | SHA1 | Date | |
---|---|---|---|
|
67c98f4d73 | ||
|
4666bc17e4 | ||
|
d91604ed2f | ||
|
1bafbb643d | ||
|
d86aa76640 |
@ -59,7 +59,7 @@ func (opts FindMilestoneOptions) ToConds() builder.Cond {
|
||||
func (opts FindMilestoneOptions) ToOrders() string {
|
||||
switch opts.SortType {
|
||||
case "furthestduedate":
|
||||
return "deadline_unix DESC"
|
||||
return "CASE WHEN deadline_unix = 0 OR deadline_unix IS NULL THEN 0 ELSE 1 END, deadline_unix DESC, name ASC"
|
||||
case "leastcomplete":
|
||||
return "completeness ASC"
|
||||
case "mostcomplete":
|
||||
@ -73,7 +73,7 @@ func (opts FindMilestoneOptions) ToOrders() string {
|
||||
case "name":
|
||||
return "name DESC"
|
||||
default:
|
||||
return "deadline_unix ASC, name ASC"
|
||||
return "CASE WHEN deadline_unix = 0 OR deadline_unix IS NULL THEN 1 ELSE 0 END, deadline_unix ASC, name ASC"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ func TestAPIIssuesMilestone(t *testing.T) {
|
||||
resp = MakeRequest(t, req, http.StatusOK)
|
||||
DecodeJSON(t, resp, &apiMilestones)
|
||||
assert.Len(t, apiMilestones, 4)
|
||||
assert.Nil(t, apiMilestones[0].Deadline)
|
||||
assert.Nil(t, apiMilestones[3].Deadline)
|
||||
|
||||
req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/%s/milestones/%s", owner.Name, repo.Name, apiMilestones[2].Title)).
|
||||
AddTokenAuth(token)
|
||||
|
Loading…
x
Reference in New Issue
Block a user