parent
88a2cede19
commit
57e5d10eee
2 changed files with 23 additions and 0 deletions
|
@ -149,6 +149,11 @@ func (tf *TaskCollection) ReadAll(s *xorm.Session, a web.Auth, search string, pa
|
|||
return nil, 0, 0, err
|
||||
}
|
||||
|
||||
sf.Filters.SortByArr = tf.SortByArr
|
||||
sf.Filters.SortBy = tf.SortBy
|
||||
sf.Filters.OrderByArr = tf.OrderByArr
|
||||
sf.Filters.OrderBy = tf.OrderBy
|
||||
|
||||
return sf.getTaskCollection().ReadAll(s, a, search, page, perPage)
|
||||
}
|
||||
|
||||
|
|
|
@ -1081,6 +1081,24 @@ func TestTaskCollection_ReadAll(t *testing.T) {
|
|||
task2,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "saved filter with sort order",
|
||||
fields: fields{
|
||||
ListID: -2,
|
||||
SortBy: []string{"title", "id"},
|
||||
OrderBy: []string{"desc", "asc"},
|
||||
},
|
||||
args: args{
|
||||
a: &user.User{ID: 1},
|
||||
},
|
||||
want: []*Task{
|
||||
task9,
|
||||
task8,
|
||||
task7,
|
||||
task6,
|
||||
task5,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
|
Loading…
Reference in a new issue