PLT-7822: Fix search order for SQL search backend. (#7704)
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
2a2af0e390
Коммит
61b023f5df
@@ -6,6 +6,7 @@ package model
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
"sort"
|
||||
)
|
||||
|
||||
type PostList struct {
|
||||
@@ -82,6 +83,12 @@ func (o *PostList) Extend(other *PostList) {
|
||||
}
|
||||
}
|
||||
|
||||
func (o *PostList) SortByCreateAt() {
|
||||
sort.Slice(o.Order, func(i, j int) bool {
|
||||
return o.Posts[o.Order[i]].CreateAt > o.Posts[o.Order[j]].CreateAt
|
||||
})
|
||||
}
|
||||
|
||||
func (o *PostList) Etag() string {
|
||||
|
||||
id := "0"
|
||||
|
||||
Ссылка в новой задаче
Block a user