mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🐛 Fix incorrect sorting in database relation field list due to premature pagination (#16425)
This commit is contained in:
parent
ce9ef11af6
commit
e9449952bd
1 changed files with 4 additions and 4 deletions
|
|
@ -1314,6 +1314,10 @@ func GetAttributeViewPrimaryKeyValues(avID, keyword string, page, pageSize int)
|
|||
}
|
||||
keyValues.Values = values
|
||||
|
||||
sort.Slice(keyValues.Values, func(i, j int) bool {
|
||||
return keyValues.Values[i].Block.Updated > keyValues.Values[j].Block.Updated
|
||||
})
|
||||
|
||||
if 1 > pageSize {
|
||||
pageSize = 16
|
||||
}
|
||||
|
|
@ -1323,10 +1327,6 @@ func GetAttributeViewPrimaryKeyValues(avID, keyword string, page, pageSize int)
|
|||
end = len(keyValues.Values)
|
||||
}
|
||||
keyValues.Values = keyValues.Values[start:end]
|
||||
|
||||
sort.Slice(keyValues.Values, func(i, j int) bool {
|
||||
return keyValues.Values[i].Block.Updated > keyValues.Values[j].Block.Updated
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue